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

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
aleemeey
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Sep 03, 2011 10:47 am

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

Post by aleemeey » Tue Sep 20, 2011 1:11 am

Hi all,

I have just deployed my website to a live host and I am getting the following issue:

- I go to Joomla 1.7 Back End
- I edit an Article in Article Manager
- I click on Save or Save As Button
- I get the following error:

Fatal error: Call to a member function add() on a non-object in /home/aleemee1/public_html/libraries/joomla/cache/storage/memcache.php on line 396

I tried to reupload my memcache.php page from local backup made from Akeeba Backup Engine but still getting the same issue.

I am using the CPanel to upload my files on the live host.

When i go to Line 396 in the memcache.php i get the following line of code (below in bold):

protected function lockindex()
{
$looptime = 300;
$data_lock = self::$_db->add($this->_hash.'-index_lock', 1, false, 30);

if ($data_lock === FALSE) {

$lock_counter = 0;

// Loop until you find that the lock has been released. that implies that data get from other thread has finished
while ( $data_lock === FALSE ) {

if ( $lock_counter > $looptime ) {
return false;
break;
}

usleep(100);
$data_lock = self::$_db->add($this->_hash.'-index_lock', 1, false, 30);
$lock_counter++;
}
}

return true;
}



Can anyone help me to resolve this issue?

Thanks in advance,

aleemeey

mjw123
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 20, 2011 12:57 pm

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

Post by mjw123 » Tue Sep 20, 2011 10:24 pm

Hi,

I had the same problem after restoring a site using Akeeba. I fixed it by going to the Global Configuration page, and on the System tab making sure all the Cache Settings were off. I found that although the main "Cache" setting was set to "OFF - Caching disabled", there was another cache setting that was still enabled. Unfortunately I can't remember what it was called and it seems to have disappeared now!

Also note that the global configuration page doesn't seem to work with IE9 (at least with Joomla 1.7), so I had to use Firefox to make this change.

Hope this helps,
Mark.

aleemeey
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Sep 03, 2011 10:47 am

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

Post by aleemeey » Thu Sep 22, 2011 6:00 am

Hi Mark,

i have disable all cache setting in the Global configuration page and it is working fine now. the other cache setting was memcache, when you disable it and save, it disappears.

Anyhow, i am no more getting the above error now.

Thanks for your help.

makevalue
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Wed Jun 04, 2008 5:24 pm
Location: Ventura County
Contact:

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

Post by makevalue » Wed Oct 05, 2011 5:46 am

Sounds similar to my issue.

The site gives me an error when I search from the home page:
Fatal error: Call to a member function setState() on a non-object in /home/landcl24/public_html/NorCalDerm/modules/mod_cn_latestarticlesplus/helper.php on line 30

I turned on FireFox error console...this shows up:
Error: MightyMagoo FF:TypeError: Components.classes['textlinks@mmagoo.com'] is undefined
Source File: chrome://mmtextlinks/content/persistence.js
Line: 74

When I search from an inside page, no error and the search displays fine.

Any ideas?
Steve

User avatar
lopezi
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Fri Aug 13, 2010 3:43 pm

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

Post by lopezi » Sat Jan 21, 2012 7:49 pm

cache OFF but error remains.

Cache Settings
Cache ...... OFF
Cache Time ......15
Persistent Memcache.......No
Memcache Compression.........No


any ideas?

User avatar
lopezi
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Fri Aug 13, 2010 3:43 pm

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

Post by lopezi » Fri Feb 10, 2012 1:32 am

Once in a while I stay tired of saving articles with that persistent error.

Fatal error: Call to a member function add() on a non-object in /home/lopezico/public_html/libraries/joomla/cache/storage/memcache.php on line 396

my cache is turned OFF, anyone knows how to fix this?

andytj
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Jul 28, 2012 9:58 pm

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

Post by andytj » Sat Jul 28, 2012 10:03 pm

Go to the configuration.php and change to this setting.
public $caching = '0';
public $cache_handler = 'file';
public $cachetime = '15';

instead of:-
public $caching = '0';
public $cache_handler = 'memcache';
public $cachetime = '30';
public $memcache_persist = '1';
public $memcache_compress = '0';
public $memcache_server_host = 'mem';
public $memcache_server_port = '11211';

This will manually change to 'file' from 'memcache' which will fix the problem. If you can't change in the settings.

sharla
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Aug 18, 2012 10:43 pm

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

Post by sharla » Sun Aug 19, 2012 7:02 pm

Hi andytj,

I was experiencing this issue and manually changing $cache_handler='file' per you suggestion worked!! Thanks very much!

didszzz
Joomla! Intern
Joomla! Intern
Posts: 70
Joined: Thu Oct 04, 2012 1:10 pm

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

Post by didszzz » Fri Oct 12, 2012 5:00 pm

Its ok i've fig it! You just need to delete the cache folder: /cache/gantry


Locked

Return to “Administration Joomla! 2.5”