Bug: Color palette defaults become empty in saved sections

Short description of issue

Palette-based color defaults work when adding blocks to new sections but after saving theme editor newly added blocks show “Select” instead of the expected palette color. Checking JSON it appears Shopify saves these settings as empty strings.

Reproduction steps

Create a section containing a block with palette-based color defaults for example:

{
“type”: “color”,
“id”: “color_bg”,
“label”: “Background”,
“default”: “{{ settings.color_palette.background }}”
}

Add the section in the theme editor, then add a block. Palette colors are correctly selected.

Save the theme editor window.

Add another block of the same type.

Now that the color picker now displays “Select” instead of the palette color.

Save again and inspect the template JSON. The setting is stored as “color_bg”: “” rather than the palette reference.

Additional info

I’ve reproduced this consistently across multiple sections and different templates.

The issue only occurs with palette-based defaults. Fixed hex defaults such as “#123123” work correctly in the same blocks.

What type of topic is this

Bug report

Upload screenshot(s) of issue

@modestasu this is right. Based on Shopify doc a color setting with no default as a local override that returns blank. You can use that and put the palette fallback in liquid.
The downside is that the editor shows “Select” for these settings from the start, but the storefront output is correct and doesn’t depend on the buggy default.

Thanks! Yeah handling empty values with a Liquid fallback is possible but I don’t think that addresses the actual issue.

The palettes are defined as defaults in the schema and they work correctly when adding blocks to a newly added section. The problem only appears after saving the theme editor with that section. Any subsequently added blocks fail to respect those defaults and instead renders empty ‘Select’.

Block defaults should behave consistently regardless of whether the section has previously been saved.