Why does uploading theme changes reset some sections content?

cmscss
Shopify Partner
176 2 204

Hi There,

Using that theme hack documented a few years back, we added sections onto other pages and haven't had an issue for years.

However, since hooking up Theme Kit, we've noticed that each time we upload a theme change, previously deleted section text returns. So each time we upload theme changes, we have to go back and remove old content from sections.

Has anyone else seen this and does anyone know how to fix?

Cheers

Ben

Reply 1 (1)
mickaelriga
New Member
3 0 0

Hello,

I just have a similar issue and I believe this is because the data that is saved for the schema fields are actually saved in the theme tree structure. In the config directory. This means that when deploying all the changes you push a fresh new config if that makes sense. Pretty tricky especially if you use Git and if you are used to code and data being separated. Let alone the fact that you probably have a live theme AND a staging theme for testing before deploying new features.

The obvious solution is to always pull the changes from Shopify before pushing anything new. Since Shopify deploys are not using Git you also need to make sure that nobody changes the data before you push again. Quite tedious.

The better suited solution is to make sure that your deploys do not push these config files so that it does not alter the data, only the code. You probably also need to ignore these in your .gitignore but I am not sure what the best rule is because some files in this directory might be needed.

Here you go.

I am still working on this issue but I hope my findings are helping you.

Cheers