Jump to content

Can't find Move Images and Legacy option.


Recommended Posts

Hi guys.

This is my first time performing Prestashop upgrade from 1.4 to 1.6.

I used 1-Click Upgrade and after the upgrade completed, all the images cannot be showed.

I tried to search on the forum and Google for solutions, mostly suggest set Legacy to Yes and Move Images.

But I can't find these 2 options under Preference -> Image and I had to rollback to 1.4.

 

Please assist me.

Link to comment
Share on other sites

Did you try to regenerate the images after the upgrade?

Hi billini13.

When I tried to regenerate the images, I got a lot of error messages saying 'Original image is missing or empty'.

Is there any settings that I need to do before upgrading?

Link to comment
Share on other sites

have you confirmed that the image is not missing?

Hi bellini.

I confirm that all the images are there. Only the image path is different.

In 1.4, all the product images are stored in img/p/ folder, but in 1.6 the product images are stored in img/p/1/

Link to comment
Share on other sites

Thats correct.  Using legacy (/img/p) was problematic when there were alot of image files.  Some operating systems have a limit as to how many files can be stored in a folder.

 

The new way (/img/p/x/y/z) alleviates this issue...

 

Let's say you have a Product 123, and this product has 1 image 456.  The image 456 will be store as follows

/img/p/4/5/6/456.jpg

 

In legacy mode, the image would be store as

/img/p/456.jpg

 

 

So, for the images that are 'missing', you first need to locate it by finding the image id (it should be in the error message you received when regenerating).

 

Once you have the image id, then go locate that image.  If it is in /img/p then you need to perform the move images function.

 

But first let us locate the image, please locate the image using the information I provided above and tell me where it is, and we will go from there.

Link to comment
Share on other sites

Thats correct.  Using legacy (/img/p) was problematic when there were alot of image files.  Some operating systems have a limit as to how many files can be stored in a folder.

 

The new way (/img/p/x/y/z) alleviates this issue...

 

Let's say you have a Product 123, and this product has 1 image 456.  The image 456 will be store as follows

/img/p/4/5/6/456.jpg

 

In legacy mode, the image would be store as

/img/p/456.jpg

 

 

So, for the images that are 'missing', you first need to locate it by finding the image id (it should be in the error message you received when regenerating).

 

Once you have the image id, then go locate that image.  If it is in /img/p then you need to perform the move images function.

 

But first let us locate the image, please locate the image using the information I provided above and tell me where it is, and we will go from there.

Hi bellini.

Thanks for your reply again and sorry for late reply.

Current issue that I'm having is, I can't see the Move Image option under Preference -> Image.

Link to comment
Share on other sites

If you are using PS v1.6.0.9, then Prestashop will hide the move images button if there are no images to move.  So either you have no images in /img/p/ or for some reason PS cannot scan that directory and thinks there are no images in there.

 

Perhaps the permissions on the /img/p folder are not setup properly?

 

If you want to force the move images button to show up, you can edit the following file

\controllers\admin\AdminImagesController.php

 

Around line 168 you will see the following code

        if ($this->display_move)
            $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array(
                'title' => $this->l('Use the legacy image filesystem'),
                'hint' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
                'validation' => 'isBool',
                'cast' => 'intval',
                'required' => false,
                'type' => 'bool',
                'visibility' => Shop::CONTEXT_ALL
            );

Just before that code section, add the following line of code, which will force the button to appear

        $this->display_move = true;

The end result should look like

        $this->display_move = true;

        if ($this->display_move)
            $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array(
                'title' => $this->l('Use the legacy image filesystem'),
                'hint' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
                'validation' => 'isBool',
                'cast' => 'intval',
                'required' => false,
                'type' => 'bool',
                'visibility' => Shop::CONTEXT_ALL
            );

 

Link to comment
Share on other sites

 

If you are using PS v1.6.0.9, then Prestashop will hide the move images button if there are no images to move.  So either you have no images in /img/p/ or for some reason PS cannot scan that directory and thinks there are no images in there.

 

Perhaps the permissions on the /img/p folder are not setup properly?

 

If you want to force the move images button to show up, you can edit the following file

\controllers\admin\AdminImagesController.php

 

Around line 168 you will see the following code

        if ($this->display_move)
            $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array(
                'title' => $this->l('Use the legacy image filesystem'),
                'hint' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
                'validation' => 'isBool',
                'cast' => 'intval',
                'required' => false,
                'type' => 'bool',
                'visibility' => Shop::CONTEXT_ALL
            );

Just before that code section, add the following line of code, which will force the button to appear

        $this->display_move = true;

The end result should look like

        $this->display_move = true;

        if ($this->display_move)
            $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array(
                'title' => $this->l('Use the legacy image filesystem'),
                'hint' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
                'validation' => 'isBool',
                'cast' => 'intval',
                'required' => false,
                'type' => 'bool',
                'visibility' => Shop::CONTEXT_ALL
            );

Hi bellini.

After added the code you suggested, the Move Image button is still not showing.

I did a quick check on the source code and found out the below function. It seems like the Move Image visibility is determined by PHP Safe Mode. Does it mean the button will only show up if the safe mode is turn on?

 

public function initMoveImages()

    {

        $this->context->smarty->assign(array(

            'safe_mode' => Tools::getSafeModeStatus(),

            'link_ppreferences' => 'index.php?tab=AdminPPreferences&token='.Tools::getAdminTokenLite('AdminPPreferences').'#PS_LEGACY_IMAGES_on',

        ));

    }

Link to comment
Share on other sites

Hi ballini.

Finally I can see the Move Image button and clicked on Regenerate Thumbnails. But in the middle of the process, I received the below error. I tried to look at the log and there's nothing inside.

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

  • 1 month later...

Hi, thankyou for all your post.

 

I followed your suggest, but when i found the image id, i look for it with ftp software but there are no images or subdirectory with that id...so what should i do now?

 

Where to look for that image of product with "id=872" for example?

In my img folder i've "admin, c, cms, co, genders, l, m, os, p, s, etc etc" folders...and under "p" folder i only have subfolder till nuber 4, so not starting with 8 as the product id.

 

What do you suggest to me?

Thankyou for your help in advance.

Link to comment
Share on other sites

Hi, thankyou for your help, but i solved finally! I explain it..

 

When i checked the ftp img folder, it was with only some images (as i told above).

 

But checking the previous backup of the website (that i've done before to upgrade and always suggest to do backup!), i see that in img folder there was much more images!

 

So i solved uploading in "img/p" folder, with ftp, all the images that i found in my backup "img/p"  folder. And after this, going on "Preference->Images" and click on "Move images".

 

Now, all products have again their images :)

 

I think this is due to some upgrade problem, but a full backup helped me to solve this.

 

To speed the website, maybe you suggest something like regenerate thumbnails now?

Link to comment
Share on other sites

To speed the website, maybe you suggest something like regenerate thumbnails now?

only if you changed themes or image dimensions.  otherwise it should not be necessary.

 

just browse your front office pages and look to see if any images are missing.  If they are missing, then run regenerate

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...