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

Support archive

Syncing variables

ChristopherDavies 29 Mar 2018 15:08 question, rejected

Issue where variables are being synced from file.

Replies

  1. Low 29 Mar 2018 15:10

    First of all, can you make sure you're at the latest LV version?

    And when you say the files come back, what is their location on the server?

  2. ChristopherDavies 29 Mar 2018 15:17

    Okay, updated to the latest.

    Now showing as all 'ungrouped' and still the incorrect data.

    Still as soon as I delete the 'exp_global_variables' rows, they re-appear.

  3. ChristopherDavies 29 Mar 2018 15:20

    Sorry, just seen your question.

    'templates/default_site/_variables

    and they also reappear in the 'exp_global_variables' table, even after I delete all rows.

  4. Low 29 Mar 2018 15:22

    Yeah, EE itself is syncing vars from file to DB using the files that are present in the _variables directory.

    Try this:

    - delete the contents of /system/user/templates/default_site/_variables (for each site)
    - restore DB tables exp_global_variables and exp_low_variables*
    - visit CP

    That should keep the data that you put in the DB, and EE will sync the DB to file, rather than the other way round.

  5. ChristopherDavies 29 Mar 2018 15:29

    Thanks Low.

    I think this has done it.

    Took a couple tries, as if you delete the variables, before the 'exp_low_variables' table, they just re-appear.

    Would be interested to know how/why this happened, if you do find a reason.

  6. Low 29 Mar 2018 15:58

    LV will create vars from existing exp_global_variables (Template Variables, or TV). TV sync from DB to file and vice versa. So, when variables re-appear, they probably exist as files on the file system, so EE will create vars based on those files, and LV will in turn list them as default vars in the LV CP.

    Before EE3, TV were not saved as files nor synced, so LV made this functionality available, and made sure no vars were created when a file exists -- only if a record in the DB existed, then the record could be synced with a file, but a var is never created. This behaviour changed in EE3 when EE started syncing TV itself, so this is most likely what causes the confusion.

    The way I look at it now, is that I have to remove all file syncing options from LV, hoping that will solve future issues.

  7. ChristopherDavies 29 Mar 2018 16:00

    Thanks for explaining Low.

    I'll watch out for an update.