Skip to content

fix: show CMS badges from nested collections on published pages#363

Merged
tristan-mouchet merged 1 commit into
developfrom
fix/nested-collection-ancestor-field-resolution
Jun 16, 2026
Merged

fix: show CMS badges from nested collections on published pages#363
tristan-mouchet merged 1 commit into
developfrom
fix/nested-collection-ancestor-field-resolution

Conversation

@tristan-mouchet

Copy link
Copy Markdown
Collaborator

Summary

Fixes CMS values that read a field from an enclosing collection inside a nested collection (bound via collection_layer_id) rendering empty on published/preview pages while working correctly on canvas. Surfaced on a client app where region "badges" inside a multi-reference collection were blank in preview.

Changes

  • Re-attribute bindings carrying an explicit collection_layer_id to that ancestor collection layer's bound-path set, so the ancestor item's reference paths get expanded during SSR
  • Load relationship target fields even when the referenced collection is also a primary (scanned) collection, so the target value is present in the cache

Test plan

  • Open a published/preview page with a nested collection whose child reads a field from the parent collection via a relationship (e.g. badge showing Region → Name)
  • Confirm the value renders (previously blank) and matches the canvas
  • Verify normal (non-nested) collection bindings still resolve
  • Verify reference fields targeting a non-primary collection still resolve

A field read from an enclosing collection inside a nested collection
(bound via collection_layer_id) rendered empty on published/preview
pages while working on canvas.

- Re-attribute bindings tagged with an explicit collection_layer_id to
  that ancestor layer's bound-path set so its reference paths resolve
- Load relationship target fields even when the target collection is
  also a primary (scanned) collection
@tristan-mouchet tristan-mouchet added the Bug Something isn't working label Jun 16, 2026
@tristan-mouchet tristan-mouchet self-assigned this Jun 16, 2026
@tristan-mouchet tristan-mouchet merged commit fc3b368 into develop Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant