Page 1 of 1

uploads/Products/ changes to uploads/_products/

Posted: Sun Nov 14, 2021 8:53 pm
by montedavis
I recently upgraded from a 1.12.2 to a 2.15.x cmsms. I've run into some issues with the Products module. For some reason the snippet of code below is redefined in my 2.15.x cmsms

<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$field->value}"/>

in 1.12.2 the parsed path is /uploads/Products/product_10/

in 2.15.x the parsed path is /uploads/_products/product_10/

my images will not display for the /uploads/_products/product_10/ url.

Any suggestions?

Thank you,

Monte

Re: uploads/Products/ changes to uploads/_products/

Posted: Sun Nov 14, 2021 11:34 pm
by DIGI3
At some point the dev switched this to use the new path for the uploads, presumably so users with File Manager access wouldn't delete product images (directories starting with an underscore are hidden from File Manager). I haven't read through all of the release notes to confirm, but that would be my guess.

I think the easiest solution would be to move the images in your file system. New products should upload them to the correct (new) place. A more complicated option would be to test for the existence of the file in the new place and, if not found, check in the old location. You can use the php function file_exists if you allow permissive Smarty in your config.

Re: uploads/Products/ changes to uploads/_products/

Posted: Mon Nov 15, 2021 12:23 am
by montedavis
Thank you! I was thinking about renaming "Products" folder to "_products" similar to what you suggest, thank for the background info.