Low variables get overwritten when deploying to the server
Hey guys! How can I get Low Variables in the CMS sync with the database? Every time my developer deploys to the server previously saved changes in the CMS are gone. Please advise. Thanks!
Hey guys! How can I get Low Variables in the CMS sync with the database? Every time my developer deploys to the server previously saved changes in the CMS are gone. Please advise. Thanks!
Replies
Low 27 Nov 2017 21:25
What's the workflow here? The dev makes changes to the vars-saved-as-files, then pushes the changes live? What are the settings for LV on the dev server and the live server in terms of syncing? And which version of LV and EE are we talking about here?
needadvice 27 Nov 2017 21:31
Thanks for getting back to me so quickly.
Workflow: 1) I update content in Low Variables from v1 to v2 and click save. 2) developer deployed changes to the EE template from his local version to the server 3) changes previously saved were reverted to v1. Not sure about the settings on the dev server. What should be the correct settings?
Version of LV: 3.0.4
Version of EE: 3.5.9
Low 27 Nov 2017 21:45
If the dev deploys templates then that shouldn't affect LV.
If the dev deploys vars that are saved as files, then you could avoid changes being overwritten by disabling the "save as files" option (and syncing) on the live server. If need be, specific files/vars can be synced manually by selecting them in the Manage Variables overview list and selecting With Selected > Synchronize.
needadvice 27 Nov 2017 22:39
I have disabled "save as files". Will let you know if it fixes the issue.
THANKS!
Low 29 Nov 2017 13:23
Your settings look fine.
Which variable types are affected by this issue? Are Grid variables affected, too?
In EE3, native Global Variables can be saved as files and synced, too. Since LV uses these native vars as a basis for its own vars, it could be that EE is updating the vars itself; you could see that in the Template section of the CP. Can you confirm that is happening?
needadvice 29 Nov 2017 14:36
Rich HTML, text, textarea, yes grid variables are affected too. I took a screenshot of the template section i found. Can you take a look and let me know if that looks correct?
I don't know if that's possible but it would be great if you could take a look at the server settings. Let me know
Thanks!
Low 29 Nov 2017 14:48
If Grid vars are affected too, then that points to something else entirely.
LV Grid vars cannot be saved as files, because the data is too intricate. The only reason why changes made to LV Grid vars are reversed, is that the database itself gets overwritten by an action outside of Low Variables. Not just the exp_global_variables table, but also any existing exp_low_variables_grid_field_X tables.
I would confer with your developer here. From what I can tell, this is not a LV issue.
needadvice 29 Nov 2017 14:55
OK. But only LV fields/grids are affected, other content fields are fine. Do you have directions on how exp_global_variables table, but also any existing exp_low_variables_grid_field_X tables should be set up?
Thanks!
Low 29 Nov 2017 15:01
Those tables are created by EE itself and shouldn't need a specific setup.
All I can deduce is that, if the Grid vars are changed back after a developer pushes changes to the site, this has to do with something outside of Low Variables, as LV cannot sync Grid vars from files. If there are changes, then they must have been made on the table itself somehow.
needadvice 29 Nov 2017 15:05
I think I'm confused. what is Grid? I thought it's a LV field type.
needadvice 29 Nov 2017 15:09
See attached- I was referring to one of the LV types
Low 29 Nov 2017 15:13
Grid is an EE-native field type that is compatible with Low Variables. If you create a variable with Grid as its variable type, it will create a table in the DB just for that var, named exp_low_variables_grid_field_X where X is the variable ID.
So. "Vars get overwritten when deploying to the server" is the issue. The only way how LV vars can get overwritten is if they're syncing with files and the files are considered newer. But, you've turned off syncing, so that's already not possible.
Then it could be possible the native global variables content gets synced to the DB for the same reason: the files on the server are considered newer than the DB content.
However, the syncing is limited to 'simple' vars only. Ones where the actual content is saved in the exp_global_variables table as text. For Grid vars, this is not possible, as the data is saved in their own table. So, logically, if you say Grid variables are affected too, something else is in play here. For some reason, the data in the Grid-specific vars is being overwritten, which can only happen outside of LV. Which is why you should probably ask your developer what exactly (s)he's doing when deploying stuff to the server.
Make sense?
needadvice 29 Nov 2017 15:30
Hey thanks for explaining. I'm not a technical person so it's hard for me to understand. I may be asking too much, but is that possible I email you the LV configuration files so you can take a look and let me know if everything looks correct?
Thanks!
Low 29 Nov 2017 16:00
You can send SuperAdmin login credentials to hi at gotolow dot com if you can. Then I'll take a look myself.
needadvice 29 Nov 2017 16:07
Much appreciated! Just sent you the credentials. Let me know if you need anything else.
Thanks!
Low 30 Nov 2017 08:14
Looked at the settings, and they look fine. As suggested, check with your developer to see what the 'deploying to the server' means to them. Currently there isn't anything I can help you with from the Low Variables codebase.
needadvice 30 Nov 2017 16:06
Hi- my developer told me all these fields are saved as files on the server. But we shouldn't save them as files, correct? I'm gonna have him delete those files and see if that fix the issue.
Thanks again.
Low 30 Nov 2017 19:32
If, on the live server, the vars are not saved as files, they will not be synced with the DB even when files from another environment are uploaded.
If the Template Variables (global vars I mentioned earlier, which LV extends) are saved as files (independently from LV), the vars could still be synced with the DB, except vars like Grid. So if the latter still changes, my previous statements still stand.
needadvice 30 Nov 2017 19:55
OK. so LV vars should not be saved as files, correct? Thanks!
Low 1 Dec 2017 11:17
Having them saved as files might be causing the issue, but they're not (I checked), so that's not it.
needadvice 1 Dec 2017 14:51
I feel like they are saved as files on my developer's local copy. Is that possible?
Low 4 Dec 2017 08:10
Possible, yes.
needadvice 5 Dec 2017 16:11
Hi there- I was wondering if you would be available to hop on a call with our developer to identify what's causing the issue. Any help would be much appreciated.
Let me know, thanks!
Low 5 Dec 2017 19:26
Dedicated support like that is not included in the LV license fee (only these forums and email). Additional support can be purchased, starting from €400.