Dirty Butter Posted February 12, 2015 Share Posted February 12, 2015 in_array() expects parameter 2 to be array, null given in /XXX/public_html/plushcatalog/605/classes/db/database.class.php on line 574 This message is in the error log over 2,000 times in a day! Any idea where I should look? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted February 12, 2015 Share Posted February 12, 2015 Jeepers creepers thats hefty.. I'm looking into it. This will definitely fix the error as it check to make sure the variable IS an array: https://github.com/cubecart/v6/commit/ee9dcb27f09b02a96b871e749b73575478e6cbf6 At the same time I'm concerned as to why it wouldn't be an array... Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2015 Share Posted February 12, 2015 It must be a JOIN. Enable debugging and disable caching. Run a typical page (for you). If the PHP error is listed at the top of the debug, look in the SQL portion for any query that has the word JOIN in it. Let us know what those queries are. I haven't come across this yet. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted February 12, 2015 Share Posted February 12, 2015 no i haven't either... keen to see the outcome Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2015 Share Posted February 12, 2015 This uses DB->query() but the problem is in the DB-select() method. function state_json() { SELECT gc.numcode, gz.id, gz.name FROM `CubeCart_geo_zone` AS `gz` LEFT JOIN `CubeCart_geo_country` AS `gc` ON gc.id=gz.country_id ORDER BY gc.name, gz.name ASC Anyway, the select() method will only set $allowed if $table does not have "JOIN" in the expression, regardless if there is $columns and/or $order. /admin/sources/orders.index.inc.php, line 643 of CC600b5. Nope. Sends a string for the $order argument. This does not check for in_array(). Catalogue->_productGallery(): // Look for images if (($gallery = $GLOBALS['db']->select('CubeCart_image_index AS i INNER JOIN CubeCart_filemanager AS f ON i.file_id = f.file_id', false, array('product_id' => $product_id), array('main_img' => 'DESC'))) !== false) { Sends an array in the $order parameter. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2015 Share Posted February 12, 2015 The rest of the code for Catalogue->_productGallery() is the same as compared to CC5213, so the added data from CubeCart_filemanager must be getting collected for the benefit of some other function, or a skin feature. Image captions? Proper values in <img> alt attributes? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 12, 2015 Author Share Posted February 12, 2015 LOL Talk about over my head!!! I will say, regarding skin, that I've tried with Blueprint AND with stock Foundation - neither stops the error message. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2015 Share Posted February 12, 2015 The code is (probably) for the skin, whether the skin uses it or not. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 OK - I'll try disabling Fusion and using stock Foundation and see what happens. I didn't do anything with Fusion when I tested it before. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 13, 2015 Share Posted February 13, 2015 I think you misunderstand. The error is not coming from the skin, but some code that makes data available for the skin. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 13, 2015 Author Share Posted February 13, 2015 Not surprising I misunderstood. I'll be busy with other projects today. Will return when 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.