Upgrading to Bakery 1.7+ : Product images disappear

svsanchez

Hello freeSbee, thank you so much for sending me the code to add to the begining of _sync_img_helper.php...

I copied the code, then opened the file via FTP and guess what... the whole code was on line 1. For some reason, when I uploaded the file it kind of got corrupted! I tried uploading a the file twice but each time the file got corrupted showing the whole code on line 1. So I opened the original file that I had downloaded, copied the whole code then pasted it on the uploaded file removing line 1.

After the file's code was correctly on the server, there was no need to add the extra code that you sent me: your original file worked perfectly and 266 files were found. Now all images appear again :)

Again thank you very much for your patience and help!

freeSbee

I see that the table is existing and I assume that the table structure is as described in my last post.

I do not know if you have really checked the php error log. Alternatively add the lines below to the file _sync_img_helper.php right after the opening comment (licence terms and disclaimer) and before the closing php tag (at about line 19).

<?php

/*
  [...]
  GNU General Public License for more details.
*/

// Error reporting
ini_set('display_errors'1);
ini_set('display_startup_errors'1);
error_reporting(E_ALL);
?>


<!DOCTYPE html>
[...]

svsanchez

Hello freeSbee, I only copied the red text with the instructions to set the image settings that appeared after the upgrade, as the rest seemed ok.

The wb_mod_bakery_images table DOES exist, but is empty as you can see on the screenshot.


freeSbee

Looks like something is missing in your database.
Did you check the Bakery upgrade log and save a copy? Please post.

If the upgrade log is not available any more, please check your database using phpMyAdmin or similar. There must be a table named [PREFIX]mod_bakery_images. If not, create it by running the SQL query below in the SQL tab of phpMyAdmin. Make sure that you have changed the table prefix "wb_" to the one defined in your WB installation.


CREATE TABLE IF NOT EXISTS `wb_mod_bakery_images` (
  `img_id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `item_attribute_id` int(11) NOT NULL DEFAULT '0',
  `filename` varchar(150) NOT NULL DEFAULT '',
  `active` enum('1','0') NOT NULL DEFAULT '1',
  `position` int(11) NOT NULL DEFAULT '0',
  `alt` varchar(255) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `caption` text NOT NULL,
  PRIMARY KEY (`img_id`)
);

svsanchez

#5
Hi freeSbee, I enabled PHP reporting and still nothing is shown with the sync script:

http://issgt.com/modules/bakery/_sync_img_helper.php

There are 2 droplet errors on the site though but I don't think they have anything to do with the missing images:

Notice: Undefined variable: section_id in /home/issguate/public_html/modules/droplets/droplets.php(37) : eval()'d code on line 7

Notice: Undefined variable: ioldSectionId in /home/issguate/public_html/modules/droplets/droplets.php(37) : eval()'d code on line 12

ALSO NOTE: I had the lastitems module installed on the homepage, and I got this error which maybe can bring some light into what is happening:

Fatal error: Call to a member function fetchRow() on a non-object in /home/issguate/public_html/modules/lastitems/include.php on line 121



freeSbee

There must be a php error.
Please enable the php error reporting or check the php error log.
Run the helper script again and report.

svsanchez

Hello freeSbee, thanks a lot for your reply. I followed your instructions:

1. Images do exist at /media/[bakery]/images/item[n]

2. I uploaded the _sync_imag_helper.php file to the /modules/bakery folder and executed it, but:

- There was no log printed to the screen
- The only thing that appeared on the screen were the instructions from point 8 (In order to complete the image settings go to the Bakery backend and enter your image data like title and alt attributes or order the images using the up- and down-arrows...)

3. I checked the site, and there are still no images showing for the products

4. Images still not appearing on the Bakery backend, but I if I go to Media via the backend I can see them all.

In case it helps, this is the URL of one of the problematic site's catalog pages:

http://issgt.com/pages/catalogo/parqueos.php

Thanks again!!!

freeSbee


  • Make sure the images are really existing at /media/[bakery]/images/ ([bakery] could be renamed)
  • If false, restore the bakery images directory using your backup.
  • If true, use the _sync_img_helper.php to do the rest.

svsanchez

Hello, I just tried upgrading from bakery 1.6 to 1.78. The problem is after the product images disappeared.

I tried following the instructions that appeared during the upgrade:

In order to set the image settings you have to open each item in the Bakery backend:

The database will then be synced automatically with the item images currently saved in the /media/bakery/ directory.
Please enter your image data.
If you set a title and no alt attribute, the title will be copied and used for the alt attribute as well.
The alt attribute is mandatory.
The image at the top position (position 1) will be used as main image.
If you enter a image caption, the image will be wrapped in a <div> container and the image will be followed after a <br> by your caption.
The item attribut generates a unique id like mod_bakery_img_attrXX_f where the XX stands for the image attribute id. This can be used for any JavaScript actions depending on the selected option attribute. Eg. change main image depending on selected item option.
Not used images can be deactivated or deleted in the backend.


For what I understand with the above instructions all I had to do was open each item so it's image would then appear and the DB would be synced. However, when I open any item no image is displayed and nothing is synced. The Product Images section for each image says "None Found". It's like Bakery is asking me to upload each image once again (I can't even chose the image from the uploaded images).

Could someone please tell me what I'm doing wrong?

Thank you!!!