All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Variables - select files bug when migrating db

Sean 15 Dec 2014 19:23 problem, rejected

Low,

EE 2.9.2
LV 2.5.0

I've found a small bug when migrating a database using Select files. In the CP the files that were selected do not carry over - see screenshot.

Interestingly the front end of the site is unaffected and the images are still displaying. I suspect that the selected images are still in the database, but the CP interface isn't displaying that correctly

This doesn't break the site, but is frustrating when migrating the db between staging/local and not seeing the images have been selected.

Replies

  1. Low 16 Dec 2014 08:01

    Not really a bug. The LV Select Files type saves its content as a full URL based on the Upload Destination, rather than using {filedir_x}filename.jpg, for example. This is so you can use it as a var {my_file} without having to use another plugin to parse the filepaths inside it, and without having to use LV's Tag syntax, eg {exp:low_variables:parse var="my_file"}.

    If the URL settings in the upload destination contains the domain of the dev site, then that will be included, and therefore not match a different location. The fact that the images are working, is because they still point to the development server.

    To change this behaviour, you can enter relative paths in the upload destination preferences, eg: /images/ instead of http://domain.com/images/ -- or re-save the files on the new server.

  2. Sean 16 Dec 2014 14:11

    Low,

    That makes sense. Looks like the FocusLab master config set's as a combination of $_SERVER['HTTP_HOST'] and relative urls which is why things it appears broken in select files. - will just have to reset the image when migrating.