Problem/Motivation

I am testing display_builder with a card SDC. If I enter a static value (textfield) as author that is being rendered when i check the view. But if I select the title of the referenced node (person content type), the title of the current page is shown.

I get no error messages. But if I select a field (field_firstname) from the referenced entity, I see

Entity node hda_display_builder has no field field_firstname

in the log.

Steps to reproduce

  • Create blog and person content type
  • Reference person via author field on blog content type
  • Edit author mapping in /admin/structure/types/manage/blog/display/card/display-builder, see config snippet below

Result:

  • Open views page that lists blog card content: No title is shown
  • Embed views block as slot in display override: Title of the current node is shown, e.g. Frontpage (not the referenced person node title)
third_party_settings:
  display_builder:
    profile: default
    override_profile: default
    override_field: field_blog_card
    sources:
      -
        node_id: 699621109914b
        source_id: component
        source:
          component:
            component_id: 'hda_theme:blog_card'
            variant_id: null
            props:
              blog_author:
                source_id: entity_reference
                source:
                  derivable_context: 'entity_reference:node:blog:field_author:node:person'
                  'entity_reference:node:blog:field_author:node:person':
                    value:
                      source_id: entity_field
                      source:
                        derivable_context: 'field:node:person:title'
                        'field:node:person:title':
                          value:
                            source_id: 'field_property:node:title:value'

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anruether created an issue. See original summary.

anruether’s picture

Title: Referenced field value does not show up display builder display » Referenced field value does not show up in display builder display
anruether’s picture

Issue summary: View changes
pdureau’s picture

Assigned: Unassigned » pdureau

Thanks @anruether for your detailed issue description. I am trying to reproduce the bug.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Postponed (maintainer needs more info)

So, I have created:

  • a person content type with a field_firstname plain text field
  • a blog content type with a field_author reference field

I am building a display for blog content type (not card but teaser but must be the same: /admin/structure/types/manage/blog/display/teaser/display-builder

third_party_settings:
  display_builder:
    profile: default
    override_profile: default
    sources:
      -
        node_id: 699714c9b5736
        source_id: component
        source:
          component:
            component_id: 'ui_suite_daisyui:avatar'
            variant_id:
              source_id: select
              source:
                value: ''
            props:
              placeholder:
                source_id: entity_reference
                source:
                  derivable_context: 'entity_reference:node:blog:field_author:node:person'
                  'entity_reference:node:blog:field_author:node:person':
                    value:
                      source_id: entity_field
                      source:
                        derivable_context: 'field:node:person:title'
                        'field:node:person:title':
                          value:
                            source_id: 'field_property:node:title:value'

When I visualize the rendered display (for example, from a View like you), I see that it is not node:person:title which is printed but node:blog:title? Is it the same issue you have ?

Also, if I use a field which exists only in node:person (like field_firstname), nothing is printed in rendered display but I have no log message about this.

Can you tell me if we share the same understanding of the issue?

pdureau’s picture

anruether’s picture

Status: Postponed (maintainer needs more info) » Active

@pdureau: I prepared a repo: https://gitlab.com/geeks4change/debug/debug_3574380 It includes:

  • blog_and_person recipe
  • blog_card SDC
  • display_builder_entity config core.entity_view_display.node.blog.card.yml

Then do:

  1. drush si minimal
  2. ddev drush recipe ../recipes/blog_and_person
  3. drush uli
  4. Create person "Marlene"
  5. Create blog, reference person "Marlene" as author
  6. drush en display_builder_entity_view
  7. Create new blog field db_source (multiple, non-required)
  8. Go to /admin/structure/types/manage/blog/display/card
  9. Configure Display_Builder, profile: Default; Field: db_source; Override profile: Default
  10. Click "Build the Display"
  11. Configure/Import: core.entity_view_display.node.blog.card.yml
  12. Go to /blog
  13. See that the author is not displayed
  14. Go to /admin/reports/dblog

To trigger the error log entry

  • drush cr
  • Go to /blog
Error: Type 	

ui_patterns
Date 	Monday, 23 February 2026 - 12:13
User 	admin
Location 	https://site-hda.ddev.site/blog
Referrer 	
Message 	Entity not found in context
Severity 	Error
Hostname 	172.18.0.5

andres alvarez made their first commit to this issue’s fork.

andres alvarez’s picture

This is not a Display Builder bug. The cause is in ui_patterns: the child source resolves its entity context to the first matching context, which is the current route node. On /blog it therefore reads the page node instead of the referenced entity, so the current node's title shows up, or "Entity not found in context" when there is no route node.

It is already fixed on ui_patterns 2.0.x by #3626950 (commit b55538e7), which makes context selection prefer the context named like the definition. It is not in 2.0.21 yet, so it needs 2.0.x-dev. Verified against the blog/person recipe from the reproduction repository: with that commit applied, the author renders on /blog.

Nothing to change in Display Builder, so I suggest closing this as a duplicate of #3626950.

mogtofu33’s picture

Title: Referenced field value does not show up in display builder display » [UI Patterns 2.0.22] Referenced field value does not show up in display builder display
Status: Active » Closed (duplicate)
Issue tags: +UI Patterns
Related issues: +#3626950: Props bound to a field of a referenced node read the route's node instead

Great, thanks for the review @andres-alvarez, so will be fixed in UI Patterns 2.0.22 release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.