MyBB Community Forums

Full Version: Call to a member function read() on a non-object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I put my hands up first to say the problems I am having are of my own making as I forgot to deactivate the plugins via to the upgrade

I am now trying to get iny to the plug ins but am getting an error message that says the following:

/homepages/............../inc/plugins/announcement.php on line 7 (the dots are just the database path)

Line 7 in that document is:

 $pluginlist = $cache->read("plugins");

Anyone know what I need to do?

Many thanks
In the function that has that line above it you need to globalize the variable $cache.
(2014-09-03, 04:41 AM)dragonexpert Wrote: [ -> ]In the function that has that line above it you need to globalize the variable $cache.

Sorry to appear stupid but what file do I nee to do this in?
Go to the /inc/plugins/announcement.php file.
(2014-09-03, 08:48 PM)dragonexpert Wrote: [ -> ]Go to the /inc/plugins/announcement.php file.

I've loaded that file and managed to add Global $cache but I am then getting the following error:

Parse error: syntax error, unexpected 'define' (T_STRING), expecting ',' or ';' in /......................../inc/plugins/announcements.php on line 12 this is a separate file as it has an 's' on the end.

I'm wondering whether this is just the announcement plugin that is causing the issue. Is there any other file in my forum that I could stop the system calling the announcement plugin?
When you go to the Plugin part of Config, it automatically loads every file in your plugin directory. If you post the contents of that file here, we can fix it for you.
(2014-09-03, 09:21 PM)dragonexpert Wrote: [ -> ]When you go to the Plugin part of Config, it automatically loads every file in your plugin directory.  If you post the contents of that file here, we can fix it for you.

Thanks for all your help but I have just tried renaming the two announcement files as announcement.old and announcement.old and the plugins have started working again!

I shall now back everything up and try upgrading to 1.8 at a later date
(2014-09-03, 10:00 PM)Gentlemanmike Wrote: [ -> ]Thanks for all your help but I have just tried renaming the two announcement files as announcement.old and announcement.old and the plugins have started working again!

That's not a correct way of doing it though - the plugin may have left unnecessary code because you didn't deactivate it. Removing/renaming plugins shouldn't be done before deactivation.
I know what you mean; I only did that as a last resort because it was stopping the plugins page loading so I couldn't get to deactivate anything.

Now that the plugin page is loaded, there is one particular plugin called My advertisements that isn't running correctly. Unfortunately, it only gives me an option to activate it and when I do it brings up an error saying that the relative tables in the database are already there (which I would expect as it was already activated when I did a backup of the database).

I have tried 'importing' the plug in again but I get error messages (probably due to the fact it has already been imported once). Any ideas how I can resolve this issue?
^ you can comment out database insertion statements in the plugin file (should be at the plugin activation section) & try it
Pages: 1 2