Author Topic: Upgrading to Bakery 1.7+ : Product images disappear  (Read 2746 times)

Offline svsanchez

  • Posts: 477
Upgrading to Bakery 1.7+ : Product images disappear
« on: March 17, 2017, 04:08:27 AM »
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_attr XX_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!!!

Offline freeSbee

  • Moderator
  • ***
  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #1 on: March 17, 2017, 10:07:36 AM »
  • 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.

Offline svsanchez

  • Posts: 477
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #2 on: March 17, 2017, 04:49:55 PM »
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.p hp 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!!!

Offline freeSbee

  • Moderator
  • ***
  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #3 on: March 17, 2017, 05:21:11 PM »
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.

Offline svsanchez

  • Posts: 477
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #4 on: March 17, 2017, 11:03:14 PM »
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
 

« Last Edit: March 17, 2017, 11:12:47 PM by svsanchez »

Offline freeSbee

  • Moderator
  • ***
  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #5 on: March 18, 2017, 09:12:32 AM »
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.

Code: [Select]
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`)
);

Offline svsanchez

  • Posts: 477
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #6 on: March 20, 2017, 03:56:41 PM »
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_image s table DOES exist, but is empty as you can see on the screenshot.


Offline freeSbee

  • Moderator
  • ***
  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #7 on: March 20, 2017, 06:02:04 PM »
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).
Code: [Select]
<?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>
[...]

Offline svsanchez

  • Posts: 477
Re: Upgrading to Bakery 1.7+ : Product images disappear
« Reply #8 on: March 23, 2017, 04:21:37 AM »
Hello freeSbee, thank you so much for sending me the code to add to the begining of _sync_img_helper.ph p...

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!

 

postern-length