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

Support archive

Once lv saved as file, saving changes in file does not take effect until saved in CP

Jim Lakey 8 Nov 2013 02:03 problem, rejected

Hi,

I looked through this post but am still not quite clear.

This is my workflow when working locally:


  1. Create variable in CP, choosing to save as file

  2. Make edit when required in text editor to saved file

  3. Save file, refresh page. Nothing changes

  4. Go to CP, variable does show updated changes, but only takes effect on the front end once I hit "save" in the CP



Is this how it is meant to work? I'd obviously much rather that saving changes to the file is instantly reflected,rather than having to go back through the CP.

My directory structure is such that I have the templates directory with all EE templates and low variables in web root, as a sibling to the EE system directory, rather than a child of it. Is that a problem? I tried setting permissions to 777 on the templates, low-variables and even system and ExpressionEngine directories, but still no joy.

Thank you!

Replies

  1. Low 8 Nov 2013 08:49

    No, changes should be saved to the DB immediately. However, it could be that there's caching involved in your templates, so the saving action clears the cache.

    You can try and see if that is the case by editing a var file, then, instead of going to the LV module page in the CP, open and save any channel entry. That will clear the cache, too. So if the changes appear on the site then, you know it's a cache issue.

  2. Jim Lakey 8 Nov 2013 23:47

    It does seem to be a caching issue. When I'm not logged into the CP, the act of saving a var file and refreshing in the browser does update the content every time. As soon as I log in to the CP, it doesn't update until I either hit save in Low Variables, or save any channel entry.

    I have "Clear cache" set to yes in the LV extension settings, so does that only take effect when you save in the CP rather than update a var file?

    If I clear the "Database cache files" in the CP, then the content of the var does update on refresh in the browser, but not if I clear any other cache files. The templates I am using do not have any template or tag caching, or any other caching applied to them right now.

    I can change the permissions for the cache directory so the caches files can't be written and that takes care of it, but is there a better way? The database caching isn't peculiar to my setup, though, so why doesn't everyone have this problem?

    Thanks for your time.

  3. Low 9 Nov 2013 07:02

    I have "Clear cache" set to yes in the LV extension settings, so does that only take effect when you save in the CP rather than update a var file?


    Indeed, it only clears cache when saving vars in the CP.

    I'm not sure why others don't have this issue. Maybe because they see it more as a caching issue than a LV issue. However, I do understand that it can be confusing in your case. I'll think of adding a setting to clear cache automatically when syncing from files.

  4. Jim Lakey 9 Nov 2013 17:12

    Thanks for clarifying, Low.

    Such a setting in a future release would definitely get my vote!

  5. Jim Lakey 18 Nov 2013 20:41

    I figured this out eventually (I was having issues with Stash, too, which led me to the culprit). I am using a config bootstrap which I set up when I was first learning ExpressionEngine and haven't looked at it much since, apart from updating db settings etc.

    I had:

    $config['enable_db_caching'] = "y";


    I now realize this setting was causing the problems.