Dirty Butter Posted February 12, 2015 Share Posted February 12, 2015 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? Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2015 Share Posted February 12, 2015 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 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 Stupid me - I should have helped you out by showing you what MY line 753 shows!! It actually IS the stock line 747! if (($results = $GLOBALS['db']->select('CubeCart_category', array('cat_id', 'cat_name', 'cat_parent_id'), false, array('cat_id' => 'DESC'))) !== false) { Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 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) { Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 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); } Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 13, 2015 Share Posted February 13, 2015 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(). Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 Done. Tested quite a few pages, with no more seo.class error messages. Will keep checking error log frequently and add to this thread if needed. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 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 { Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 14, 2015 Share Posted February 14, 2015 I hope the programmers will avail themselves to look at your hosted space. You've got something strange going on. This should not be happening. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 14, 2015 Author Share Posted February 14, 2015 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'); } Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 14, 2015 Share Posted February 14, 2015 See post #9. Do the same as in post #6. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 14, 2015 Author Share Posted February 14, 2015 Support Ticket opened. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 14, 2015 Author Share Posted February 14, 2015 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. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted February 16, 2015 Share Posted February 16, 2015 Thanks for the ticket I'll take a look as soon as I can. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.