MyBB Community Forums

Full Version: ACP call to member function on non-object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When trying to access our Admin CP, we get thrown the following error:
Fatal error: Call to a member function set_language() on a non-object in /home/duckydud/public_html/toontowners/global.php on line 94

I just downloaded a fresh copy of MyBB 1.6 (What we are running), and replaced global.php, /admin/index.php, /inc/init.php, and /inc/class_language.php. I can post the full text if you really want. Ideas?
I've snipped your URL; there's something wrong with your files, your admin backups directory was on show to everybody, anybody could have downloaded a backup of your database.

Will edit this post with help on the error, just posting this to explain why I snipped it.
D'oh! I forgot I had a .htaccess to make my portal show, but it seemed to carry onto subfolders. I'll look elsewhere to fix that, and may I put the link back if I fix it?
(I'll make a new reply instead of editing my last one.)

How exactly is your file system setup?? It's saying it's in the toontowners folder but that folder doesn't seem to exist, is that folder set to be the root folder for your domain??

(Typed before I saw your latest reply) Do you have a .htaccess in your admin folder?? It's not got any directory index set, if you access your admin folder with no file at the end of the URL it just lists the contents, which is why I could see the contents of your backups folder, so you need to have a look at that. The necessary index.html file is there like it should be, but your server isn't using it. Also I don't know where you got your copy of global.php from, as set_language called on line 90, not 94. Also, the ACP index.php doesn't even load global.php

Yeah, once you've fixed it you can put the link back, only removed it to protect your backups.
Answers:
I have shared hosting, /home/duckydud/public_html/toontowners/ is my root directory for the domain.

Well, I just downloaded a copy of MyBB an hour ago or so, and that is where I got my global.php.

I just disabled the DirectoryIndex for the time being, I want my ACP first Toungue

Just for kicks, I tried including /inc/class_language.php directly, so that had some extra blank lines. I took it out of the code for now.

EDIT: Ooh, I can't AJAX edit posts or AJAX quote posts either.
Ah OK, adding that would explain the difference in line number.

Doesn't explain why global.php is even being included here; have you installed any plugins??

What happens when you try to edit/quote?? Nothing at all?? I assume this is the small multiquote button rather than the 'Reply' button.
(2010-10-30, 10:17 PM)MattRogowski Wrote: [ -> ]Ah OK, adding that would explain the difference in line number.

Doesn't explain why global.php is even being included here; have you installed any plugins??

What happens when you try to edit/quote?? Nothing at all?? I assume this is the small multiquote button rather than the 'Reply' button.

AJAX edit: Spinning Wheel Comes up and stays, post becomes
Fatal error: Call to a member function set_language() on a non-object in /home/duckydud/public_html/toontowners/global.php on line 90
AJAX quote: Quote becomes:
<br />
<b>Fatal error</b>:  Call to a member function set_language() on a non-object in <b>/home/duckydud/public_html/toontowners/global.php</b> on line <b>90</b><br />

I could put my /admin/index.php on Pastebin, if you want, and I do have plugins. About 12.
Probably won't be specifically ./admin/index.php then if the same error is happening in other places... it's weird though that the forum is fine in other places, and looking at it again, it can't be a plugin as the first plugin hook that's run is called after set_language is called Confused I can't think why it'd only happen in these specific files.
OK, here was my issue:

In an attempt to modify a plugin slightly, I used the MyBB integrator, which defined its own version of $lang. Since the plugin was called in the ACP, it got confused. I removed the stuff, and board works great. Marked as solved.