Topic-icon [SOLVED] Disable System - JFBCSystem plugin on specified menu items

Active Subscriptions:

None
10 years 8 hours ago - 9 years 11 months ago #43369 by Krx
Hello

Is it possible to disable loading "System - JFBCSystem" plugin on specified Joomla menu items?
I've found that code from it is interfering with jgrid component, and access to jgrid component is given only to users with special privileges - Super Admins.
On those Joomla menu items JFBConnect is not needed anyway.

Joomla 2.5.19
JFBConnect Version: 6.0.2


regards
Last edit: 9 years 11 months ago by Krx.
The topic has been locked.
Support Specialist
There isn't a way to do disable the plugin on certain pages. My guess is that the Social Tool bar that should show at the bottom of the page is causing issues. If you don't need that toolbar (to help diagnose your Open Graph tags or to let your admins push content to your Facebook Pages, Twitter Streams, or LinkedIn Company pages), then you can disable it with the minor code change below.

To disable it, please edit the /components/com_jfbconnect/libraries/toolbar.php file. There are two functions in there that look like:
public function onAfterDispatch()
    {
Add "return;" after that line, like:
public function onAfterDispatch()
    {
         return;
Do the same for the onAfterRender function lower in the file. That should disable the toolbar and hopefully clear you conflict.

If you want those features, let us know a little more about the problems you're running into and we'll gladly help diagnose things.

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

None
Hi

I already did that and I'm actually looking forward to see option for that in Component settings.
Problem still remains.

I've created PM for you with admin access so that you may take better look about issue.

Regards
The topic has been locked.
Support Specialist
We'll gladly help investigate further. However, I've never used jgrid before. Can you let me know more about what issues you're running into so that I know what to look for?

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

None
Hi

I've already sent you PM message with login and other details where you can see what's happening.

Regards
The topic has been locked.
Support Specialist
Thanks for the info. I just got into the site. The issue looks to be how JFBConnect tries to modify the output to add our contents. Your jgrid extension is using a ton of Javascript, and one of the statements is confusing JFBConnect.

What I'd recommend is a bit of code that will disable the JFBCSystem plugin in that section. It's what you asked for originally, but not something we have as an option (or plan to add) within JFBConnect. To do so, edit the /plugins/system/jfbcsystem/jfbcsystem.php file. Around line 25, you'll see:
function __construct(& $subject, $config)
    {
Update that code so it looks like:
function __construct(& $subject, $config)
    {
         if (JRequest::getInt('Itemid') == 1959)
             return;
1959 is the Menu Item id for your jgrid item, so that should get you going.

Let us know how that goes. We'll look into updating our code to properly detect situations like you're running into and work better so that you won't need that code.

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

None
Hi

I tried your suggestion but it didn't work. I also tried to put menu id within quotes.

Than I tried to echo menu id by using all known ways to output Joomla current active menuid,
Most of them worked when adding code in template index.php file,
but not a single one when adding code in jfbcsystem.php plugin file in suggested line.
It seems that usual ways to call Joomla menu item id doesn't work in that part of plugin code.

Any other suggestion?

Thanks
The topic has been locked.
Support Specialist
Your correct. That code won't work there yet because Joomla won't have come up with the full route for your page at that point.

Remove that code and skip down to line 139 and add the code in the onAfterRender() function, just like mentioned above. That should hopefully get you going. Sorry for the confusion, and keep me posted on how that goes!

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

None
Hi Alex

This last suggestion works perfectly.
Now I can use jgrid (with ton of its javascript, lol) without problems.
Thanks a lot for your assistance.

Thread marked as "solved"

Regards
The topic has been locked.
Support Specialist
Awesome! Glad to hear that got you going, and sorry for the issues you ran into. We will look into how to improve our detection of the opening <body> tag better. You're the first with this issue though, so we'll have to tread carefully to try to fix your issue without breaking others.

As for the jGrid extension, I wasn't saying all the Javascript is a bad thing.. just that there was a lot, which makes conflicts more possible. If it gets the job done though, great.

If you run into anything else, just let us know. Also, I'd recommend bookmarking this thread so that you have the fix handy for the next release (v6.0.5), as that won't have a fix for our body tag detection.

Thanks,
Alex
The topic has been locked.