Problem
Sections can contain both .liquid and .json files. The .json files reference the .liquid files as a way to group them together. If a .json file is uploaded before the .liquid file is uploaded, a 422 Unprocessable Entity error is thrown.
Example
header-group.json and header.liquid are both stored in the /sections folder and are uploaded in this order.
header-group.json
|
header.liquid
|
{
"name": "Header Group",
"type": "header",
"sections": {
"header": {
"type": "header",
"settings": {
"color_scheme": "scheme-1"
}
}
},
"order": [
"header"
]
}
|
<h1>This is the header</h1>
{% schema %}
{
"name": "Header",
"class": "section-header",
"settings": []
}
|
|
Failed
|
Success
|
The Cause
When uploading a theme, Syncify iterates through the files in alphabetical order (presumably). Because header-group.json is uploaded before header.liquid, the referenced section doesn't exist on the store.
If we were to run the upload argument again, it'll work, since the file is now present from the previous upload job.
Solution
Syncify should iterate through all the .liquid files first, then iterate through the .json files.
Problem
Sections can contain both
.liquidand.jsonfiles. The.jsonfiles reference the.liquidfiles as a way to group them together. If a.jsonfile is uploaded before the.liquidfile is uploaded, a 422 Unprocessable Entity error is thrown.Example
header-group.jsonandheader.liquidare both stored in the/sectionsfolder and are uploaded in this order.header-group.json
header.liquid
{ "name": "Header Group", "type": "header", "sections": { "header": { "type": "header", "settings": { "color_scheme": "scheme-1" } } }, "order": [ "header" ] }The Cause
When uploading a theme, Syncify iterates through the files in alphabetical order (presumably). Because
header-group.jsonis uploaded beforeheader.liquid, the referenced section doesn't exist on the store.If we were to run the upload argument again, it'll work, since the file is now present from the previous upload job.
Solution
Syncify should iterate through all the
.liquidfiles first, then iterate through the.jsonfiles.