Topic-icon Fatal error

Support Specialist
13 years 2 months ago #32018 by alzander
Replied by alzander on topic Fatal error
Miles,
No problem. We don't mean to be overzealous about the new post. It just really helps keep things tidy and focused around here.

Bettychung,
Thanks for the PM with the link to the page. Unfortunately, that didn't help us like we were hoping I can't really tell how things are configured within JFBConnect to cause that error to happen. Things like the Like/Comment Content settings (in the Social Configuration area), the Open Graph object settings you may have for that category of the article with problems, and details of the article itself (since the page won't load).

Would it be possible to Private Message us a set of Super Admin credentials so we can see all the different configuration settings that are leading to that Fatal Error. We'd really love to get to the bottom of it, but just can't understand what's causing it right now.

If not, we can probably come up with a code change that should fix the problem... but without knowing the full underlying reason of it, we won't be able to be certain that our fix will work in every case.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 2 months ago #32030 by Bettychung
Replied by Bettychung on topic Fatal error
Hi Alex,
Of cause I can provide the admin access to you for figure out what exactly wrong with it. I will send you the access by personal message. Thanks for your help.
The topic has been locked.
Support Specialist
13 years 2 months ago #32038 by alzander
Replied by alzander on topic Fatal error
Miles,
Thank you so much for the access credentials. Once we could see your settings, it was very easy for us to recreate the problem and diagnose what is happening. Basically, you have your article category set to "Registered". The article itself is empty.

Our Open Graph logic will try to fetch the image from the category *if* no image can be found in the article. Since your article has no text/image in it, JFBConnect is trying to get the information about the category, but Joomla won't allow that since the user is a guest.

We have a fix that we've implemented and tested, but I couldn't test on your site. If you're up for making a minor code change, we'd love to hear your feedback. To do so, please edit the /libraries/sourcecoast/articleContent.php file. Around line 379, you'll see:
static function getCategoryImage($catid)
    {
        $content = JCategories::getInstance('content');
        $category = $content->get($catid);
        $image = $category->getParams()->get('image');

        $fullImagePath = '';
        if($image)
        {
            $fullImagePath = SCArticleContent::_getImageLink($image);
        }

        return $fullImagePath;
    }
Replace that entire function with the code below. There's a few minor changes, and it's just easier to replace the whole thing:
static function getCategoryImage($catid)
    {
        $content = JCategories::getInstance('content');
        $category = $content->get($catid);
        $fullImagePath = '';
        if ($category)
        {
            $image = $category->getParams()->get('image');

            if ($image)
            {
                $fullImagePath = SCArticleContent::_getImageLink($image);
            }
        }

        return $fullImagePath;
    }
Please test and let us know how that goes. And again, thanks so much for letting us have the access. It really helped us find a difficult issue for us to diagnose and find on our own!

Alex
The topic has been locked.
Active Subscriptions:

None
13 years 2 months ago #32088 by Bettychung
Replied by Bettychung on topic Fatal error
Hi Alex, it works now.
instead of showing the error message, it will notice by "You are not authorised to view this resource."
Thanks!
The topic has been locked.
Support Specialist
13 years 2 months ago #32096 by alzander
Replied by alzander on topic Fatal error
Awesome. Thanks for the confirmation that the change works. This will definitely be in the next release.

Alex
The topic has been locked.