WordPress / WordPress/create-block-theme

Template part does not save to child theme, but parent theme.json does

Open
#71 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
417
Forks
66
PR merge metrics
No merged PRs in 30d

Description

This is may be related to #67.

When I save changes to a child theme:

  • changed templates save as expected to the child templates folder
  • but changed template PARTS save to neither child nor parent, but are nonetheless removed from database, and lost

Also, the entire parent theme.json is saved to the child theme.json, which is not what I expected.

I expected only the differences to the parent theme.json to be saved to the child theme.json.

In my case I had only a new color palette in my child theme theme.json, so I expected that upon saving, the child theme.json would still have only the child color palette and nothing else.

My limited understanding is that on page load, objects in the child theme.json overwrite objects in the parent theme.json? If so, my concern is that any later update to the parent theme.json will no longer be visible because a prior version of the parent will have been copied into the child.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the child-theme save flow described in the issue, comparing changed template parts with changed templates in the child templates folder. Inspect how the parent and child theme.json files are handled during saving and verify database removal behavior. Done means template parts persist and child theme.json contains only child differences, preserving later parent updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.