TDLWebs Posted December 1, 2019 Share Posted December 1, 2019 I recently upgraded a store from v6.2.2 to 6.2.8 and now there are thousands of images not showing up, both in categories and products. The upgrade failed from the admin option so I had to manually upload the 6.2.8 files and perform a manual upgrade. The System Error Log is showing; File: [dashboard.index.inc.php] Line: [360] "SELECT I.name, I.product_code, I.stock_level AS I_stock_level, I.stock_warning AS I_stock_warning, I.product_id, M.stock_level AS M_stock_level, M.use_stock as M_use_stock, M.cached_name FROM `CubeCart_inventory` AS `I` LEFT JOIN `CubeCart_option_matrix` AS `M` on `I`.`product_id` = `M`.`product_id` WHERE use_stock_level = 1 AND ((M.status = 1 AND M.use_stock = 1 AND M.stock_level <= ) OR (I.stock_level <= )) ;" - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') OR (I.stock_level <= ))' at line 1 and on Database Maintenance there is; CubeCart_order_summary.custom_oid has a key type KEY but expecting UNIQUE KEY. The site literally does feature thousands of products and the cache is huge, so I don't know if that has anything to do with it. Can anybody offer help? I will be happy to pay for a fix. T Link to comment Share on other sites More sharing options...
bsmither Posted December 1, 2019 Share Posted December 1, 2019 This query is supplying info for a Dashboard report on what products need attention with respect to their stock levels being at or below a set value. In admin, Store Settings, Stock tab, there is a choice on an admin's Stock Warning Method: Product Specific, or Global. If Global, be sure to have an integer value entered in the following text entry field. Do not leave it blank. If Per Product, then for each product, General tab, have a value entered in the text entry field for Stock Level Warning. It defaults to zero (0). Do not leave it blank. The Database Maintenance warning is an advisory, and really does not cause damage to your store or database. However, for a database upgraded to CC628, with this advisory still being reported, suggests that the database itself may not have been upgraded to the CC628 schema. In admin, Maintenance, Upgrade tab, the database schema versions are listed along with the date that schema was put in place. Is 6.2.8 listed? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 1, 2019 Author Share Posted December 1, 2019 Hi bsmither, Thanks for your response. I fixed the stock settings by entering an integer as advised. I can confirm that 6.2.8 is now listed but there was a warning in admin for a while advising that the files had updated but the database hadn't. After running a manual upgrade this went away. Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 2, 2019 Share Posted December 2, 2019 20 hours ago, TDLWebs said: I recently upgraded a store from v6.2.2 to 6.2.8 and now there are thousands of images not showing up, both in categories and products. It is always good to get the other issues sorted as you have done but those are highly unlikely to have been causing the problems with images not being displayed. If you go onto a product page with missing images and type CTRL and F5 keys together to force a refresh, do the images then show ? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 2, 2019 Author Share Posted December 2, 2019 5 hours ago, havenswift-hosting said: It is always good to get the other issues sorted as you have done but those are highly unlikely to have been causing the problems with images not being displayed. If you go onto a product page with missing images and type CTRL and F5 keys together to force a refresh, do the images then show ? No, unfortunately not. Nothing I've tried works. I really need an expert to take a look behind the scenes to confirm whether it can be recovered or not. Any offers? Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2019 Share Posted December 2, 2019 You say thousands of images don't show up for products or categories. Do any images show in the File Picker list? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 2, 2019 Author Share Posted December 2, 2019 Yes, they all appear to be there on the server. But for some reason, don't seem to be associated with the categories or products any more. Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2019 Share Posted December 2, 2019 Any other errors in the error log? I just worked on a database problem referring to PHP's function count(). And there is this: https://github.com/cubecart/v6/issues/1931 but I cannot determine what the cause nor the fix was. Link to comment Share on other sites More sharing options...
TDLWebs Posted December 2, 2019 Author Share Posted December 2, 2019 5 minutes ago, bsmither said: Any other errors in the error log? I just worked on a database problem referring to PHP's function count(). And there is this: https://github.com/cubecart/v6/issues/1931 but I cannot determine what the cause nor the fix was. No, it's clear now. I read the thread on Github but no clues there either. I'm totally flummoxed. Link to comment Share on other sites More sharing options...
TDLWebs Posted December 2, 2019 Author Share Posted December 2, 2019 When I inspect the source code it says (unknown) in the img src ???? Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2019 Share Posted December 2, 2019 What page are you viewing and what skin is this? Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2019 Share Posted December 2, 2019 What is the exact version of PHP are you running? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 2, 2019 Author Share Posted December 2, 2019 7.3.12 Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2019 Share Posted December 2, 2019 Using a database utility, such as phpMyAdmin found as a tool in your hosting account's control panel: View the contents of the database table CubeCart_image_index. Are there a lot of records? View the contents of the database table CubeCart_category. In the 'cat_image' column, do most of the records have a non-zero value in them? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 2, 2019 Author Share Posted December 2, 2019 cubecart_image_index = 12387 rows Yes, most of the records have a non-zero value although there are some zeros Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2019 Share Posted December 2, 2019 Ok, then we know that the association between the Inventory product_id and the File Manager's file_id is not lost. Here is something that needs to be fixed, but it's a low-priority. The changes between CC622 and CC628 quite likely involved changes to the administration skin's javascript. I see evidence of this because in the image you posted of the File Picker, the list of images is taller than the box, yet there is no vertical scroll bar. (But that could just be something about your browser.) So, to make sure your browser is using the latest version of that javascript file, and not still using the version held in the browser's internal cache, force your browser to reload page resources (images, CSS, javascript). This usually done with CTRL-F5. If that doesn't work... We need to determine why CubeCart is not collecting the names of the assigned images for the product and category edit pages in admin. One more check on the database: Look at CubeCart_filemanager. Make sure there are thousands of records here. We will next use your browser's Developer Tools to examine the response CubeCart sends when the File Picker makes its separate AJAX request for file names of folders and images. Please activate your browser's Network Analysis tab in its Developer Tools. In admin, bring a product up for editing. You will see a waterfall of requests. Two of those requests will be caused by XHR (AJAX). View the Response of the first request. It will be an array, with the first few being folders, and after those being images. In each image element, there will be an 'assigned' element with a value of 0, 1, or 2. The code posted above, what template file is this, and what skin? Link to comment Share on other sites More sharing options...
TDLWebs Posted December 3, 2019 Author Share Posted December 3, 2019 I have cleared the cache and reloaded admin so believe that the latest version of Javascript is being used. The absence of the scrollbar is due to the Mac OS - it appears when I start to scroll. CubeCart_filemanager in the database shows 14256 rows I'm not sure that I'm looking at the right thing in Chrome developer tools: The code is from the view product template and the skin is Galaxy X Link to comment Share on other sites More sharing options...
bsmither Posted December 3, 2019 Share Posted December 3, 2019 The Network tab is correct. When you click on the first entry, a panel should slide into view with a Response tab. There, you should see the array of folders and images, and if any of these images are assigned to the product, that should be reflected in the array. I have the Galaxy X v1.4 skin, and the code is different that what the above screen shot shows. Link to comment Share on other sites More sharing options...
TDLWebs Posted December 3, 2019 Author Share Posted December 3, 2019 5 minutes ago, bsmither said: The Network tab is correct. When you click on the first entry, a panel should slide into view with a Response tab. There, you should see the array of folders and images, and if any of these images are assigned to the product, that should be reflected in the array. Ok, thanks. Here is what I found for one of the listings: And this for a newly added product with the image showing up ok: They look the same to me, but maybe I'm looking at the wrong thing???? Link to comment Share on other sites More sharing options...
bsmither Posted December 3, 2019 Share Posted December 3, 2019 The 'assigned' values are all zero? So, we need to track down why CubeCart isn't setting any image (in the selected folder) as assigned -- assuming there is supposed to be an assigned image in the folder being viewed. Link to comment Share on other sites More sharing options...
bsmither Posted December 3, 2019 Share Posted December 3, 2019 Using a database utility such as phpMyAdmin, execute this query: SELECT file_id, main_img FROM CubeCart_image_index WHERE product_id = 8178; Be sure to prepend any table prefix your database may be using. Write down the file_id numbers shown in the result. In CubeCart_filemanager, find those file_id values. Link to comment Share on other sites More sharing options...
TDLWebs Posted December 4, 2019 Author Share Posted December 4, 2019 12 hours ago, bsmither said: Using a database utility such as phpMyAdmin, execute this query: SELECT file_id, main_img FROM CubeCart_image_index WHERE product_id = 8178; Be sure to prepend any table prefix your database may be using. Write down the file_id numbers shown in the result. In CubeCart_filemanager, find those file_id values. Ok, done that. The only file_id number shown in the result was 15725 . When I tried to find 15725 in Cubecart_filemanager there was nothing: Link to comment Share on other sites More sharing options...
bsmither Posted December 4, 2019 Share Posted December 4, 2019 This appears to be a case where the file_id values in the CubeCart_filemanager table got renumbered somehow. I think your best approach to this is to download the backup that CubeCart made on the upgrade attempt, extract the SQL dump for the CubeCart_filemanager table, and see if there is a record with file_id of 15725 there. (It's all plain text, so a competent text editor should be able to search for 15725.) If that record is there, then I suggest you replace the existing table contents with the SQL structure and contents for that table you just extracted. Link to comment Share on other sites More sharing options...
TDLWebs Posted December 4, 2019 Author Share Posted December 4, 2019 2 hours ago, bsmither said: This appears to be a case where the file_id values in the CubeCart_filemanager table got renumbered somehow. I think your best approach to this is to download the backup that CubeCart made on the upgrade attempt, extract the SQL dump for the CubeCart_filemanager table, and see if there is a record with file_id of 15725 there. (It's all plain text, so a competent text editor should be able to search for 15725.) If that record is there, then I suggest you replace the existing table contents with the SQL structure and contents for that table you just extracted. Fantastic! That appears to have fixed it Thank you VERY MUCH!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.