Topic-icon Errors After Update | Broken Extensions

Active Subscriptions:

None
9 years 11 months ago #47322 by htshot42
I updated to the latest version of JFBConnect today and now a few of my extensions are not working properly. RokSprocket will not load more results and K2 Filter and Search will not display the number of results when a box is checked.

The website is www.vegassuitesource.com

When I check a box on the search page, I get the following error

Fatal error: Call to undefined method JDocumentRaw::addCustomTag() in /home6/onezerb6/public_html/vss/plugins/system/jfbcsystem/jfbcsystem.php on line 164

The search still works but it does not display the realtime results available.

If I comment out the lines below in jfbcsystem.php, everything goes back to working as normal.

// Called right before the page is rendered
public function onBeforeRender()
{
if (!JFactory::getApplication()->isAdmin())
{
if (JFactory::getUser()->authorise('jfbconnect.opengraph.debug', 'com_jfbconnect') && JFBCFactory::config()->get('facebook_display_errors'))
JFBCFactory::addStylesheet('jfbconnect.css');

JFactory::getDocument()->addCustomTag('<SourceCoastCSSPlaceholder />');
}
}


Any help would be great
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #47326 by opt2bout
I'm so glad I found this post (thank you htshot42).

I noticed a problem with RokSprocket (RocketTheme) and the following error...

Error: Error: RokSprocket Error [model: strips, model_action: getPage, params: {"moduleid":"439","page":2}]: [object Object]
Source File: ourwebsite.com/components/com_roksprocke...ksprocket.request.js
Line: 16

When I commented out the lines 156-166 in /plugins/system/jfbcsystem/jfbcsystem.php as htshot42 noted, the problems go away.

Joomla 3.3.4
PHP 5.4.32

System - JFBCSystem v6.2.0
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #47328 by opt2bout
Note: I can just edit out the new line of code on line 164:

JFactory::getDocument()->addCustomTag('<SourceCoastCSSPlaceholder />');

and the problem goes away. Not sure what the addCustomTag is supposed to do, but this helps keep the other code that may be of use :)
The topic has been locked.
Support Specialist
9 years 11 months ago #47338 by alzander
Ahhh.. so sorry for the issue and thanks for the amazing sleuthing work.

The fix should be to edit 159 of the jfbcsystem.php file. There, you'll see:
if (!JFactory::getApplication()->isAdmin())
Update that to:
if (!JFactory::getApplication()->isAdmin() && $doc->getType() == 'html')
That will prevent our code from working on AJAX requests, which it shouldn't be doing.

We'll have this implemented in the 6.2.1 release, which will be out over the next day or so since this is going to cause quite a few people issues.

If you make the change, we'd love to have your feedback to ensure it fixes the problem as expected.

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

None
9 years 11 months ago - 9 years 11 months ago #47346 by htshot42
I updated the line of code you suggested and my website went completely blank. Any page I went to was just a blank white page.

I don't know anything about php, so I don't know why this works, but if I update the suggested line to:
if (JFactory::getApplication()->isAdmin() && $doc->getType() == 'html')

Then everything goes back to working correctly. The only difference in this line is the lack of a "!" in front of "JFactory"

The only things that don't display correctly on my site now are the social sharing buttons. They are stacked vertically instead of horizontally. I just used CSS to fix the problem, but I would like to know if this workaround will cause more problems in the future?

Thanks for your help

UPDATE:
As soon as I posted this I tried to login to the administrator area and it was a blank white page. The only thing that seems to work is commenting out lines 157 - 166.
Last edit: 9 years 11 months ago by htshot42.
The topic has been locked.
Support Specialist
9 years 11 months ago #47354 by alzander
I'm sooo sorry for the incorrect fix. The code should be:
if (!JFactory::getApplication()->isAdmin() && JFactory::getDocument()->getType() == 'html')
In the code I posted, I copied from another line in the same file where $doc had been declared. In that section, it wasn't available, and why the error was being thrown. Removing the ! made it work because that first statement was failing (you weren't in the admin area) and so the right hand side wasn't being evaluated. Conversely, in the admin area, that was failing for the same reason since the right side was being evaluated, and failing.

We're planning to get a release with this fix out either later today or tomorrow. Feedback on the above is welcome, but we're also running JFBConnect through our automated test suite which should find any collateral damage from the above fix (unlikely).

As for the styling, that's breaking because the jfbconnect.css file isn't being included when you comment all those lines out.. so the above fix should fix all these problems... and hopefully introduce none :)

Thanks again for your patience,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #47358 by opt2bout
That (the latest) works for me.
The topic has been locked.
Support Specialist
9 years 11 months ago #47361 by alzander
Awesome! Thanks so much for the update. We're finalizing testing on the v6.2.1 release for this and a minor CSS issue and it will likely be out later today if everything goes as planned. This fix will definitely be in it.

Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #47385 by htshot42
Perfect! Thank you for your help.
The topic has been locked.
Support Specialist
9 years 11 months ago #47387 by alzander
New release is up :) We already have a 6.2.2 release planned with some minor bug fixes, but that won't be until (likely) next week, unless something major comes up.

Thanks again for all the feedback,
Alex
The topic has been locked.