3614889 - 3614889 — Fix per-placement overrides breaking when the same entity...

3614889 - 3614889 — Fix per-placement overrides breaking when the same entity is referenced more than once, and apply overrides directly to the entity

Field overrides configured on one placement of a referenced entity were silently being applied to every other placement of that same entity on a page, or not applied at all, because render context was established too late in the entity render pipeline and the referenced entity's rendered output was being cached under placement-agnostic keys. Additionally, the module's own documentation promised overrides would be applied directly to the entity object so templates could use standard field access with no theme changes required, but the code only ever set side-channel template variables. This fixes both issues, verified against a live case of the same node referenced from two separate paragraphs with different Feature Style and Background Color overrides.

Change log:

  • Added in to establish per-placement render context before a parent entity's fields are built, instead of in , which fires only after the referenced entity has already fully rendered (formatters run before that hook in ), guaranteeing the override was always one render pass too late
  • Trimmed to only handle overrides and nested-override propagation reads, with a docblock explaining why render-context pushing had to move out of it
  • Moved the render-cache bypass () into ; an earlier attempt at setting it in was silently discarded because that hook's is 's fields-only array, which gets merged into the real entity build via — and PHP's never overwrites a key () the left side already has
  • Added in the file, an entity-type-agnostic replacement for the node-only , used to decide when a referenced entity's render must bypass caching
  • Updated to call for each direct override on the entity object itself (resolved via //), so -style raw field access in templates reflects overrides with no template changes, matching the module's documented behavior
  • Added import required by the new bundle-config helper

Merge request reports

Loading
Loading