Jump to content
TDLWebs

RESOLVED - Images Disappeared - Urgent Help Needed

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

You say thousands of images don't show up for products or categories.

Do any images show in the File Picker list?

Share this post


Link to post
Share on other sites

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.

 

tpt-cc-img.jpg

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites

When I inspect the source code it says (unknown) in the img src ????

image.thumb.png.99ea77d04bfd555559b222a51b455f99.png

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

cubecart_image_index = 12387 rows

Yes, most of the records have a non-zero value although there are some zeros

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

image.png.53f78fb6249ea4eef90544a0b4d2d18d.png

I'm not sure that I'm looking at the right thing in Chrome developer tools:

dev-tools.thumb.jpg.d1f4382f65af5864aefd0dc50ed22092.jpg 

 

The code is from the view product template and the skin is Galaxy X

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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:

image.thumb.png.bee074596231f20d1f7c7d06250a0dad.png

And this for a newly added product with the image showing up ok:

image.thumb.png.faf4529d2fcb39faf7a3a3f1fb5cfc0c.png

They look the same to me, but maybe I'm looking at the wrong thing????

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

.sql-query1.thumb.jpg.8105ea2914ca1a069435621c390d0c7e.jpg

When I tried to find 15725 in Cubecart_filemanager there was nothing:sql-query2.thumb.jpg.dec7de51fe26612c36d3290f2e9541ac.jpg

 

 

Share this post


Link to post
Share on other sites

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.

  • Thanks 1

Share this post


Link to post
Share on other sites
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!!!!! 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...