Dirty Butter Posted October 14, 2013 Share Posted October 14, 2013 I have this section in my products.index.inc.php: // Filemanager - Images // if (($uploaded = $filemanager->upload()) !== false) { KNOWN BUG if (($uploaded = $filemanager->upload() && is_array($uploaded)) !== false) { // Fix for invalid argument for next statement foreach ($uploaded as $file_id) { $_POST['image'][(int)$file_id] = true; } } When I created a new product, I had to manually click on the X to change it to a star to make the image show up in the product listing. What needs to be done to fix this section? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 14, 2013 Share Posted October 14, 2013 That fix is for those who really, really want the warning message to no longer appear in the error log. That code, unchanged, has no affect on the operation on CubeCart. Unchanged, an error is logged if there was no image uploaded when the product details form was submitted. If one or more images were submitted, then the foreach would have a valid argument and all would be peachy with the world. If you wish to have the one and only image uploaded and/or assigned to a product to automatically be 'starred', then we need to look elsewhere. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 If you wish to have the one and only image uploaded and/or assigned to a product to automatically be 'starred', then we need to look elsewhere. OK. Normally our plush items only have one photo, so it always did automatically star it before 5.2.4. When we had multiple images it check marked all but the last one and starred that one, all automatically. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 14, 2013 Share Posted October 14, 2013 "When we had multiple images it check marked all but the last one and starred that one, all automatically." That's still in the CC524 code. None of that has changed. I have not yet splayed out the CC523 nor CC524 code, so I do not yet know how these versions work. Yet. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 If not the products.index.inc.php file, what files are suspects that I should I check to see if I've goofed in upgrading from 5.2.2 to 5.2.4? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 14, 2013 Share Posted October 14, 2013 In CC524, products.index.inc.php, line 345, starts the processing of the list of images that are being uploaded. The first thing it does is to get the list of uploaded images from $filemanager->upload(). The CC524 file /classes/filemanager.class.php, line 589, function upload(), is the code that changed after CC522. I don't know what the change affected. My impression is that, even with the changes in filemanager, nothing different happens in products.index.inc.php. So, look in your CC522 Filemanager->upload() to determine if you made any edits that affect the CC_image_index table. (I find that difficult to understand why an edit to do that would be placed in this function, however.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 My current filemanager.class.php is the same as the original 5.2.4. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 I have determined that there is no record being added to the image_index table unless I star the image manually. This does work automatically in the lite version of 5.2.4 that I have installed for testing purposes. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 14, 2013 Share Posted October 14, 2013 Assuming (big assumption!) there is no intended difference between Pro and Lite with regard to automatically 'starring' the last image in the set that was uploaded, let's look at the possibility that the database is corrupt. Are you using a test database for the Lite CC524? If so, please have phpMyAdmin check the validity of the CC_image_index table for the Pro CC524. (Just a wild guess.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 The Lite DOES have its own database. I'm not familiar with "checking validity", but I used Check and Analyze via PhpMyAdmin and the response was OK for both. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 14, 2013 Share Posted October 14, 2013 I have no answer, then, until I do my thing with the CC524 code. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 I've tried the same image upload on a test product on the estates store, and it's also not automatically putting the star - and the image_index does not have anything. So it's not a database issue. I created MY plushcatalog 5.2.4 and used it to create the estates 5.2.4 with a few differences, so it's a software issue. I'll mark them manually with the star until you've had time to work it out. Thanks!!!! Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 14, 2013 Share Posted October 14, 2013 I cannot detect a difference in the file admin_enc_ion.php between CC522 and CC524, so I believe there is no difference to what or how any of the feature lockouts may differ. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 14, 2013 Author Share Posted October 14, 2013 It has to be something I have done wrong in blending my edits into 5.2.4. The problem is knowing where to look LOL. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 16, 2013 Author Share Posted October 16, 2013 I finally tracked it down by a process of elimination, exchanging my folders/files with original 5.2.4 versions until I was able to get an image to work automatically. The problem in products.index.inc.php was my attempt to include an edit that was supposed to be a fix for no options to be processed causing error messages. Either I merged that edit incorrectly, or it's not needed in 5.2.4. You can mark this as resolved. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 16, 2013 Share Posted October 16, 2013 It's still needed in CC524 to silence the Warning: foreach(), Invalid argument supplied. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 16, 2013 Author Share Posted October 16, 2013 Thanks, Bsmither. I'll try again to follow your directions for stopping that error message and see if I can get that working properly without breaking anything else. Oooh how I love upgrading! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 18, 2013 Author Share Posted October 18, 2013 Maybe this isn't quite resolved after all. I added back in this code again to products.index.inc.php, since I now have a working copy of this file. Again, with this added, I do not get a starred image automatically. So evidently this bug fix needs tweaking. // Filemanager - Images // if (($uploaded = $filemanager->upload()) !== false) { KNOWN BUG PER BSMITHER if (($uploaded = $filemanager->upload() && is_array($uploaded)) !== false) { // Fix for invalid argument for next statement foreach ($uploaded as $file_id) { $_POST['image'][(int)$file_id] = true; } } 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.