Dirty Butter Posted October 8, 2013 Share Posted October 8, 2013 It's hopefully a previously edited version that I have updated incorrectly, but I'm getting this error when I opening the Dashboard. [08-Oct-2013 17:45:30 UTC] PHP Warning: array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /XXXXX/public_html/plushcatalog/classes/seo.class.php on line 230 Any idea what I've done wrong? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 8, 2013 Share Posted October 8, 2013 That section of code has not changed as of CC522. If this happens consistently, then enable debug mode and look for a query such as: SELECT * FROM CubeCart_seo_urls WHERE path = something. There may be several, but one will have a path that is definitely not legitimate. If that does not reveal anything, then in CC524, line 229, after: $item_vars = $this->_getItemVars($item[0]['type'], $item[0]['item_id']); Add: trigger_error('Trying to array_merge ' . print_r($item_vars,true) . 'from' . print_r($item,true)); Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 8, 2013 Author Share Posted October 8, 2013 [08-Oct-2013 20:00:37 UTC] PHP Warning: array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /XXXXXXX/public_html/plushcatalog/classes/seo.class.php on line 230 [08-Oct-2013 20:02:12 UTC] PHP Notice: Trying to array_merge Array ( [_a] => product [product_id] => 2639 ) fromArray ( [0] => Array ( [id] => 2765 [path] => disney-large-pink-chenille-core-piglet-hot-pink-stripe-velour-body [type] => prod [item_id] => 2639 ) ) in /home3/butter01/public_html/plushcatalog/classes/seo.class.php on line 231 I checked that product, and the image appears to be OK. The next time I cleared the error log and refreshed the Product Summary I found a category instead of a product in the error message. I looked at the error log too soon. After giving it some time it did create a long list of fromArray info. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 8, 2013 Share Posted October 8, 2013 Well, $item_vars certainly is an array. So is $_GET, otherwise it wouldn't be a problem. I'll have to trace it out. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 8, 2013 Author Share Posted October 8, 2013 This is now a real functionality issue for me. Contact Us is not working, and it's this same error, except the page is crashing this time. [Notice] /XXXXXXx/public_html/plushcatalog/classes/seo.class.php:231 - Trying to array_merge Array ( [_a] => contact ) fromArray ( [0] => Array ( [id] => 368 [path] => contact-us [type] => contact [item_id] => 0 ) ) [Warning] /XXXXXXXX/public_html/plushcatalog/includes/lib/smarty/sysplugins/smarty_resource.php:349 - filemtime() [function.filemtime.php]: stat failed for /XXXXXXXX/public_html/plushcatalog/skins/blueprint/templates/content.contact.php [Warning] /XXXXX/public_html/plushcatalog/includes/lib/smarty/sysplugins/smarty_resource.php:349 - filemtime() [function.filemtime.php]: stat failed for templates/content.contact.php [Exception] /XXXXXXXXXX/public_html/plushcatalog/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'templates/content.contact.php' I have a mod that my be causing this, as it's not working on the front end product listing. Ask about a product is the mod, but there are so many variations on this error message I'm having second thoughts that this mod is the cause. I disabled it and still got the crash. Will comment out the code and see what that does. [Notice] XXXXXXXXX/public_html/plushcatalog/classes/seo.class.php:231 - Trying to array_merge fromArray ( [0] => Array ( [id] => 6428 [path] => large-pink-mama-pig-flower-hair-bow-collar-5-babies-zipper-tummy-askabout-3257 [type] => askabout [item_id] => 3257 ) ) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 9, 2013 Author Share Posted October 9, 2013 I'm seeing changed code in cubecart.class.php that sure looks like it's at least related to my problem. Maybe one of my mods or edits doesn't like this change: $meta_data = array( 'name' => $contents['doc_name'], 'path' => null, 'description' => $contents['seo_meta_description'], 'keywords' => $contents['seo_meta_keywords'], 'title' => $contents['seo_meta_title'], ); $GLOBALS['seo']->set_meta_data($meta_data); The old code had 'path' => $GLOBALS['seo']->getdbPath('doc', $doc_id), Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 9, 2013 Share Posted October 9, 2013 Unable to load template file 'templates/content.contact.php' That's bad. Very bad. Array ( [0] => Array ( [id] => 6428 [path] => large-pink-mama-pig-flower-hair-bow-collar-5-babies-zipper-tummy-askabout-3257 [type] => askabout [item_id] => 3257 ) In a stock CC5, there is no type of item (not a literal item) called 'askabout'. So there must have been an edit to the function _getItemVars (line 749 in seo.class.php). Please examine that function from your last known working codebase. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 9, 2013 Author Share Posted October 9, 2013 Ask about is a "mod". I'm trying to find a way to temporarily disable it, but it was a very complex set of edit directions, rather than a plugin. I've been able to work around it in the skin, so at least the Contact Us forum is now working. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 9, 2013 Author Share Posted October 9, 2013 Well, I found the issue in seo.class.php that was causing the Contact Us issue, and now Ask About a Product is working properly, as well as Contact Us. Phew! BUT, now my 5.2.4 version of seo.class.php only has your debug code and the change to remove index.php if last chars in URL - otherwise it's the same as back in June. And the same error messages continue to accumulate. Maybe I messed up the upgrade of another file. Any suggestions where I should look? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 9, 2013 Share Posted October 9, 2013 Which errors are still getting logged? The array_merge error? I cannot explain why PHP is reporting this error as $item_vars is an array, but try this, near line 230: From: $_GET = (is_array($_GET)) ? array_merge($item_vars, $_GET) : $item_vars; To: $_GET = (is_array($_GET)) ? array_merge((array)$item_vars, $_GET) : $item_vars; Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 9, 2013 Author Share Posted October 9, 2013 This is what I'm still getting: [09-Oct-2013 16:22:38 UTC] PHP Notice: Trying to array_merge Array ( [_a] => product [product_id] => 2981 ) fromArray ( [0] => Array ( [id] => 2988 [path] => ty-2002-pluffies-rust-tan-brown-white-whiffer-dog [type] => prod [item_id] => 2981 ) ) I'll try your code change and report back. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 9, 2013 Author Share Posted October 9, 2013 Still the same long list of error information when I SAVE a product (didn't do anything to it other than just Save. The product I saved is NOT in the error list. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 9, 2013 Share Posted October 9, 2013 The "Trying to array_merge..." is from the trigger_error() I had you put in the code. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 9, 2013 Author Share Posted October 9, 2013 I took off all the tracing code you had me add - I didn't realize that was not still errors it was showing. So far so good - the mistakes I found in seo.class.php must have fixed this. Keeping my fingers crossed, and thank you as always for your patient help. 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.