PrestaSafe / prettyblocks

Page builder open for source for PrestaShop
Academic Free License v3.0
71 stars 31 forks source link

Save relative URLs of images in database #52

Open micka-fdz opened 1 year ago

micka-fdz commented 1 year ago

We need to save relative URLs instead of absolute URLs.

bc-devle commented 1 year ago

Agreed, with full URLs we have to replace domain / subdomain text in database when we change (I did it earlier).

in the meantime here are some requests to do it : update ps_configuration set value = replace(value, 'old_domain', 'new_domain'); update ps_prettyblocks_lang set state = replace(state, 'old_domain', 'new_domain');

PrestaSafe commented 1 year ago

Agreed to, i'll try to find a solution for that, but it could be complicated with virtual uri un multishop. Full domain it's easier when we need to change it.

micka-fdz commented 1 year ago

After a discussion with @jf-viguier, we think it would be necessary to store only files path in DB. URLs can be easily calculated using PrestaShop methods to manage different cases (multishop, multilingual...).

PrestaSafe commented 1 year ago

Hi everyone, yes we will change that, but we need to think of all the problems it could generate (prestashop in sub folder, multishop multilang etc...) We will probably use the HelperBuilder with the : $/path/to/img for generating the url. A lot of tests should be made