Page 1 of 1

Fatal error: Call to a member function get() on a non-object

Posted: Sun Aug 02, 2015 3:13 am
by agah
Hi, I'm getting this error on my website Fatal error: Call to a member function get() on a non-object in .../index.php on line 97 and I can't access to admin panel. What could be causing this? Thanks.

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Sun Aug 02, 2015 6:33 pm
by agah
Any help on this??

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Mon Aug 03, 2015 1:26 am
by agah
Please guys, any help on this?

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Mon Aug 03, 2015 2:56 am
by Kenberne1965
Is this a new install? or is it from a cart that was working but now isnt?

if its a new one, id check your host is running php 5.4 or above.

if its an existing previosuly working opencart then what did you do before it broke?

ie did you install any new mods, or change any files?

Paul

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Mon Aug 03, 2015 3:09 am
by IP_CAM
and always tell the folks, what you have, and use, as OC-Version, and Mod's.
Otherways, you sure won't get very far, around here, and with no wizzard's in sight!
Ernie

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Mon Aug 03, 2015 4:22 am
by agah
Kenberne1965 wrote:Is this a new install? or is it from a cart that was working but now isnt?

if its a new one, id check your host is running php 5.4 or above.

if its an existing previosuly working opencart then what did you do before it broke?

ie did you install any new mods, or change any files?

Paul
Thanks for the response, man. It was working previously, but it is broke for like 4 or 5 days.

I installed Vqmod, it gave the same error on the site but after I changed the permissions of Vqmod file it got back to normal. I didn't add any other extension after that, I tried to upload some images to image/catalog file. Then the next day it was like this. I tried to replace index.php files, I changed their permissions and shit. But it's still broke and at this point I'm about to cry. I feel like there is a very simple solution to this but I just can't figure out what it is. So yeah...this is the current situation.

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Mon Aug 03, 2015 4:43 am
by artcore
What's on line 97 in that file?
'non-object' means it doesn't exist - It's usually due to a corrupt or unreadable file in your system directory. The only get() functions I can think of are in the config, language and controller classes. So I would check those for permission (although in a modern setup this is no issue) and content. They're all in the system/library and system/engine folder respectively.
Files permission should be 644, folders 755 - don't put them on 777.

Is your front end normal?

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Mon Aug 03, 2015 11:39 pm
by agah
artcore wrote:What's on line 97 in that file?
'non-object' means it doesn't exist - It's usually due to a corrupt or unreadable file in your system directory. The only get() functions I can think of are in the config, language and controller classes. So I would check those for permission (although in a modern setup this is no issue) and content. They're all in the system/library and system/engine folder respectively.
Files permission should be 644, folders 755 - don't put them on 777.

Is your front end normal?
Thanks, I changed the permissions as you said but still no change.

Line 97 goes like this:

if ($config->get('config_error_display')) {
echo '<b>' . $error . '</b>: ' . $errstr . ' in <b>' . $errfile . '</b> on line <b>' . $errline . '</b>';
}

if ($config->get('config_error_log')) {
$log->write('PHP ' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line ' . $errline);
}

Could this be an issue about Vqmod extension?

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Tue Aug 04, 2015 1:42 am
by artcore
How about the front end? And did you check the file contents? In this case compare system/library/config.php with the original OpenCart version.

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Tue Aug 04, 2015 5:46 pm
by Kenberne1965
Could this be an issue about Vqmod extension?
one way to find out, rename your xml folder to xml-temp and then create a blank xml folder this will temporarily disable any VQmodding. re-run the site, if it works copy over 1 .xml file at a time from the temp folder to the new xml folder until it comes up with the error, then you got your culprit.

If it still errors then delete the new xml folder, rename xml-temp back to xml and at least you know its not a VQmod issue.

PB

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Tue Aug 04, 2015 11:24 pm
by agah
@artcore, @Kenberne1965 OH MY GOOOODDD!!!! I don't know why but for some reason it was because of Vqmod folder. I deleted it completely (after replacing index.php files with the originals) and the problem is gone. I can't believe this shit. I will never install vqmod again.

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Wed Aug 05, 2015 2:03 am
by artcore
I would never have suspected vqmod as I rely on it every day. It couldn't have been an extension as an xml mod can't change the indexes. So it must've been a faulty installation. I say don't give up on it yet ;)

Happy you found it though!

PS It's important to use the latest version of vqmod for oc2, now: 2.5.1
https://github.com/vqmod/vqmod/releases
https://github.com/vqmod/vqmod/wiki/Troubleshooting

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Wed Aug 05, 2015 3:53 pm
by Kenberne1965
Glad you got it sorted, but Id agree VQmod plays a big part in customizing opencart, I wouldn't let this bad experience put you off, there is VQmod logs in the VQmod folder, maybae have a look at these if youve still got them, they may tell you which xml file was causing the problem.

Paul

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Sat Aug 08, 2015 6:44 pm
by agah
@Kenberne1965 @artcore Hey guys, it's me again. Thanks for all your support. Now I'm facing a new error.

"Warning: File could not be uploaded for an unknown reason!" What could be the reason for this? Thanks again.

Re: Fatal error: Call to a member function get() on a non-ob

Posted: Sat Aug 08, 2015 8:27 pm
by artcore
Hi,
I think it's best to start a new topic and explain in detail what you are trying to achieve.
;)