Jump to content

5.2.16 constant error message - call to member function....


Dirty Butter

Recommended Posts

Call to a member function select() on a non-object in /XXXX/public_html/plushcatalog/classes/seo.class.php  on line 753

 

I saw that someone was having problems with this message quite a few versions back, but I thought this had been fixed.

 

I'm getting so many of them in a course of a few minutes that the error log is useless to me, as far as spotting any important messages in it.

 

I understood from the other post that this is an unimportant message. If so, is there any way to keep this message from showing?

Link to comment
Share on other sites

No such thing in CC600b5. Is this CC5216? There is a likely statement on line 753 of CC5216.

 

Read the bloody Subject!

 

There is the same type of statement just six lines earlier. So, if there aren't error messages noting line 747, I do not know how there would be a problem with the one and not the other.

 

This isn't a problem for me.

 

And it would be incredibly useful if we could know what error message immediately precede the one(s) you are referencing.

 

On line 747, make this edit to the specific part of the statement:

Was:
if (($results = $GLOBALS['db']->select
 
Now:
if (($results = Database::getInstance()->select
Link to comment
Share on other sites

Your edit on both instances seems to have worked!

// CURRENT if (($results = $GLOBALS['db']->select('CubeCart_category', array('cat_id', 'cat_name', 'cat_parent_id'), false, array('cat_id' => 'DESC'))) !== false) {
//BSMITHER ERROR MESSAGE HACK LINE BELOW
if (($results = Database::getInstance()->select('CubeCart_category', array('cat_id', 'cat_name', 'cat_parent_id'), false, array('cat_id' => 'DESC'))) !== false) {			
foreach ($results as $result) {
					$this->_cat_dirs[$result['cat_id']] = $result;
				}

				// Write over with translations
			// CURRENT	if (($translations = $GLOBALS['db']->select('CubeCart_category_language', array('cat_id', 'cat_name'), array('language' => $language))) !== false) {
//BSMITHER ERROR MESSAGE HACK LINE BELOW
if (($translations =	Database::getInstance()->select('CubeCart_category_language', array('cat_id', 'cat_name'), array('language' => $language))) !== false) {				

Link to comment
Share on other sites

Celebrated too soon - now getting this:

 

Call to a member function write() on a non-object in /XXX/public_html/plushcatalog/classes/seo.class.php on line 770

 

My line 770 is

				if (!empty($this->_cat_dirs)) {
					$GLOBALS['cache']->write($this->_cat_dirs, 'seo.category.list.'.$language);
				}
Link to comment
Share on other sites

To be clear, something is calling this function out of sequence. Or some thing is crashing PHP or telling it to start shutting down too early.

 

A few lines up, you see Session::getInstance() and Language::getInstance() are used. Experiments have shown this is necessary because these classes are not yet instantiated in some cases. (I think that's what the experiments showed.)

 

But there is no reason why the database ($GLOBALS['db']) and the cache ($GLOBALS['cache']) classes would have disappeared or not have been instantiated by the time this function is called.

 

So, follow the pattern and use Cache::getInstance().

Link to comment
Share on other sites

Thought to check v6.0.b5 error log, and a similar error shows up there, too:

 

[13-Feb-2015 22:02:27 UTC] PHP Fatal error:  Call to a member function read() on a non-object in /xxx/public_html/plushcatalog/605/classes/seo.class.php on line 725

 

 

$cache_id = 'seo_check';

		if($GLOBALS['cache']->read($cache_id)) {
			return false;
		} else {
Link to comment
Share on other sites

I have, with your help and other paid developers, deviated considerably from a stock install, as you know. But I will ask for Support Help. No error messages overnight as detailed above, but one new similar one. Since it comes earlier, maybe provides a clue?? These error messages are not new - just been ignoring them since they didn't seem to effect the workings of the store. But I'm trying to clean things up in anticipation of v6 upgrade. Thanks, as always, for your insight and patient help!!

 

Call to a member function get() on a non-object in /XXX/public_html/plushcatalog/classes/seo.class.php on line 193

	/**
	 * SEO enabled?
	 *
	 * @return bool
	 */
	public function enabled() {
		return $GLOBALS['config']->get('config', 'seo');
	}
Link to comment
Share on other sites

I've just received notice of a new order via PayPal AND from the Admin email to us. But there is NO evidence of the order in the Admin or in cPanel order_summary or order_history. That has never happened before. Could these edits I made today in this thread be responsible? If so, I'll have to undo them and hope CC Support can find the issue.

 

I just did a test order, and it all worked as it should have. The delivery address on PayPal is a confirmed addess for that person, so it should be safe to process the order. HOW Strange!!

 

Whacky order was made on test v6 site - I had failed to take it OFFLINE!!! So at least that mystery is solved.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...