Topic-icon System - JFBCSystem Content - JFBCContent Stop my site working

Active Subscriptions:

None
12 years 4 days ago - 12 years 4 days ago #44535 by uglyeoin
Hi there,

My site wasn't working when I moved to my new host (Siteground). I asked them why, and they suggested it was your plugins

System - JFBCSystem Content &
JFBCContent

Here are the errors:

Fatal error: Call to a member function onAfterInitialise() on a non-object in /home/****/public_html/plugins/system/jfbcsystem/jfbcsystem.php on line 94
Fatal error: Access to undeclared static property: JLoader::$classes in /home/****/public_html/libraries/loader.php on line 195

When I disabled them the site did indeed work, but I don't understand why. Can you tell me what I need to do to get this working again and what functionality I may have removed?

Thanks in advance,
Eoin
Last edit: 12 years 4 days ago by uglyeoin.
The topic has been locked.
Support Specialist
I'm unsure why you're seeing that error, and it's not something we've ever heard of before.

The first error you mention is from our system plugin. The code in question is:
$doc = JFactory::getDocument();
            if ($doc->getType() == 'html')
The first line should simply be getting the 'document' from Joomla itself, which is what stores and setups the output for the page. That's absolutely critical and a standard function of Joomla. The error is from the 'if' line, which seems to be complaining that $doc is null, which (again) is not something I've ever heard of before.

Fatal error: Access to undeclared static property: JLoader::$classes in /home/****/public_html/libraries/loader.php on line 195

I'm not sure what's causing this error. When does this occur?

As for what happens when you disable the plugins:
* If you disable the JFBCContent plugin, you'll lose the sharing icons on your content.
* If you disable the JFBCSystem plugin, you'll lose all JFBConnect functionality. That plugin is absolutely required for Facebook functionality.

I hope that helps explain some things a bit more. That's a very obscure error though and unheard of. We have many users on SiteGround sites, so not sure what would be happening there with the JFactory::getDocument() call.

Keep me posted if you have further clarifications or have any more details.

Thanks,
Alex
The topic has been locked.
Support Specialist
Actually.. I just re-read the error and looked at the code again. The first error is:
Fatal error: Call to a member function onAfterInitialise() on a non-object in /home/****/public_html/plugins/system/jfbcsystem/jfbcsystem.php on line 94
Line 94 in the JFBCSystem plugin is what I posted above. However, the onAfterInitialise() call is actually on line 61 in JFBConnect v6.0.6. What version of JFBConnect are you using? It seems like you are likely using an older version of JFBConnect and/or some files are not installed properly and, hence, causing that error.

Please re-install JFBConnect and ensure you're on v6.0.6

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

None
I am using 6.0.6 I'll try reinstalling a few times. I did have older versions but I installed the most recent. Is there something I should be doing when I install other than just installing as if a new extension? I get errors all the time saying bits are out of date when I know I'm installing the latest version
The topic has been locked.
Active Subscriptions:

None
Nope, no joy. I just get a white screen. It worked fine on my old server, I can't understand it. Could it be because I'm using a hosts file to access it on the new server at the moment?

The error occurs on the homepage all all other pages. It goes away when I disable those plugins. It's weird. What do you suggest I do? I very much doubt Siteground will help me to troubleshoot a 3rd party extension, although they are helpful so I can try them. If they conclusion they come to is that it's the extensions fault I'm kind of screwed.

I might try reinstalling all of the Joomla files to see if that helps.
The topic has been locked.
Support Specialist

I get errors all the time saying bits are out of date when I know I'm installing the latest version

What kind of errors are you getting? Can you let me know the messages? That may help narrow down what's happening.

To debug further, I'd recommend doing some visual inspection of the files. First, in the Global Configuration area, set Error Reporting to 'Maximum'. That should show the errors on that blank white page, which will make narrowing things down easier.

With that error in hand, unzip the com_jfbconnect package. Then, find the file on your site that is throwing the error and compare the line that is throwing the error with the original file from the package. If they are different, it means that the Joomla installer isn't properly copying the files. That could be due to permissions issues or other server related things.

If the files are the same (another good check is to verify both files are the same size and same number of lines), then let me know the exact Fatal Error that's happening, if different than posted above.

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

None
12 years 3 days ago - 12 years 3 days ago #44560 by uglyeoin
Thanks for the advice Alex.

With the content plugin enabled I get this error.

Fatal error: Class 'JFBCFactory' not found in /home/****/public_html/plugins/content/jfbccontent/jfbccontent.php on line 59

Fatal error: Access to undeclared static property: JLoader::$classes in /home/****/public_html/libraries/loader.php on line 195

The files are the same size and both lines say the same thing

If I turn on the system plugin too I get this error

Fatal error: Call to a member function onAfterInitialise() on a non-object in /home/kepplewr/public_html/plugins/system/jfbcsystem/jfbcsystem.php on line 61

Fatal error: Access to undeclared static property: JLoader::$classes in /home/kepplewr/public_html/libraries/loader.php on line 195

Again both files are the same size and have the same line coded in them.

If I turn off the content plugin and leave the system plugin on, I get the second error. With both on The second error. With just the content one on I get the first error. I don't understand why with both plugins on I don't get both errors.
Last edit: 12 years 3 days ago by uglyeoin.
The topic has been locked.
Support Specialist
That helps narrow things down a lot. If you enable the JFBCContent plugin by itself (without the JFBCSystem plugin) the error you see is actually a known problem. That will be fixed in the JFBConnect v6.1 release. It's obscure though as the System plugin should always be enabled.

For the system plugin, the error line number has changed from 94 to 61, which is correct. So, something obviously did change when you upgraded. That means we need to check just a few other directories and files to see where something else is going wrong.

Can you go to the /components/com_jfbconnect/libraries directory and compare the following files against the /frontend directory in the installer package:
factory.php
provider.php
provider/facebook.php
provider/google.php
provider/linkedin.php
provider/twitter.php

The factory file is what loads all of the others. The provider.php file has the onAfterInitialise function which isn't working for some reason. The /provider/xyz files may also have an onAfterInitialise function that overrides the provider.php file. My guess is that one of those files is missing/different than it should be.

If that doesn't help, we'll need to FTP into the site to narrow things down further as I'm not sure what's happening. Please PM me those credentials.

One other thing, you mention the errors are below when the system plugin is enabled:

Fatal error: Call to a member function onAfterInitialise() on a non-object in /home/kepplewr/public_html/plugins/system/jfbcsystem/jfbcsystem.php on line 61

Fatal error: Access to undeclared static property: JLoader::$classes in /home/kepplewr/public_html/libraries/loader.php on line 195

Generally, there can be only 1 fatal error on a page. At that point, it's 'fatal', and nothing else can execute.. so that's a little strange that you're seeing 2 errors.

Also, the loader.php file is a Joomla core file. The line at 195 is using a variable called $classes. The error that that is an undeclared static property is disconcerting because it's definitely declared at line 25. I'm not sure why you'd be seeing that error, but it definitely seems something may be wrong with the Joomla installation in general. Of course, we'll help investigate however we can.. but if Joomla was installed by SiteGround, they may have some ideas why that error is occurring. I was testing on Joomla 2.5.20. I'm assuming that's your version as well.

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

None
I have now reuploaded all of those files (quicker than comparing), I did this manually.

I then ensured Joomla! was up to date at 2.5.20

Then I downloaded a copy of Joomla, and extracted everything except for the config / htaccess files and uploaded them to my server.

I'm still getting the same error.

Fatal error: Call to a member function onAfterInitialise() on a non-object in /home/****/public_html/plugins/system/jfbcsystem/jfbcsystem.php on line 61

Fatal error: Access to undeclared static property: JLoader::$classes in /home/****/public_html/libraries/loader.php on line 195
The topic has been locked.
Active Subscriptions:

None
12 years 3 days ago - 12 years 3 days ago #44570 by uglyeoin
Having replaced all of the files that come up in the errors.

Fatal error: Call to a member function onAfterInitialise() on a non-object in /home/kepplewr/public_html/plugins/system/jfbcsystem/jfbcsystem.php on line 61

Fatal error: Class 'JFactory' not found in /home/kepplewr/public_html/libraries/joomla/session/storage/database.php on line 71

This error does not stay it reverts to the other error
Last edit: 12 years 3 days ago by uglyeoin.
The topic has been locked.