Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pro variables file field portability #2498

Closed
robinsowell opened this issue Nov 3, 2022 · 2 comments · Fixed by #3223
Closed

Pro variables file field portability #2498

robinsowell opened this issue Nov 3, 2022 · 2 comments · Fixed by #3223
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@robinsowell
Copy link
Contributor

Per report:
If you save a link to an image using a stand-alone Low Variable the value chosen is written to a file in the _variables template directory and the content comprises the full URL to the image.

If you put an image field into an LV grid and pick / save the same image, LV saves the filedir definition of the image path to the db.

What this means is when you move the site from a staging server to live server, any image links that are set using image fields in grid fields continue to work after the move, but any that were saved as single variables don’t (unless the staging server is visible to the live server).

@robinsowell robinsowell added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Nov 3, 2022
@intoeetive
Copy link
Contributor

intoeetive commented Nov 17, 2022

On my testing with Pro Variables on EE7, I got different results.

When using Grid with File column, the data are only saved to database (not file) and the file format is correct in the form of {file:1:url}

Using the built-in File dropdown variable type is saving the full path indeed.

I think we need to consider replacing all built-in PV variable types with EE fieldtypes - this will make code more DRY, things more manageable and consistent and should solve problems like this.

@TomJaeger for your consideration

@intoeetive
Copy link
Contributor

After discussion, we decided that we do this for File field, and is it's not much effort then for other fields as well.

intoeetive added a commit that referenced this issue Apr 5, 2023
enabled parsing `{file:XX:url}` in global variables

added `file` as reserved field name
intoeetive added a commit that referenced this issue May 2, 2023
…ile-ft

Enabled File field to be used as Pro Variable; #2498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants