Skip to content

Fix template merge logic to preserve allOf blocks#196

Merged
ericof merged 2 commits into
mainfrom
fix-merge-allof
May 22, 2026
Merged

Fix template merge logic to preserve allOf blocks#196
ericof merged 2 commits into
mainfrom
fix-merge-allof

Conversation

@erral
Copy link
Copy Markdown
Member

@erral erral commented May 22, 2026

Discovered that merge_template_configs was dropping the allOf block from JSON schemas when merging a downstream template with an upstream one.
Since conditional questions are defined using allOf / if / then blocks, any conditions defined in a downstream template (custom project) were being lost.

This PR:

  • Updates merge_template_configs to correctly append downstream allOf items to the upstream list.
  • Adds a regression test in tests/config/test_merge_template.py.

This works in tandem with the fix in tui-forms (collective/tui-forms#23) to enable conditional questions in cookieplone templates.
Related tui-forms PR: collective/tui-forms#23

@erral erral requested a review from a team as a code owner May 22, 2026 13:42
@ericof
Copy link
Copy Markdown
Member

ericof commented May 22, 2026

Just run the formatter and should be ready to be merged

@ericof ericof merged commit 05f27b6 into main May 22, 2026
10 checks passed
@ericof ericof deleted the fix-merge-allof branch May 22, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants