Problem/Motivation

Dale Moore got this error:

The website encountered an unexpected error. Try again later.
Drupal\Component\Plugin\Exception\ContextException: The 'entity:paragraph' context is required and not present. in Drupal\Core\Plugin\Context\Context->getContextValue() (line 73 of core/lib/Drupal/Core/Plugin/Context/Context.php).
Drupal\ui_patterns\Plugin\UiPatterns\DerivableContext\EntityReferencedDerivableContext->getDerivedContexts() (Line: 124)
Drupal\ui_patterns\Plugin\UiPatterns\Source\DerivableContextSourceBase->getSourcePlugins() (Line: 95)
Drupal\ui_patterns\Plugin\UiPatterns\Source\DerivableContextSourceBase->getPropValue() (Line: 199)
Drupal\ui_patterns\SourcePluginBase->getValue() (Line: 87)
Drupal\ui_patterns\Element\ComponentElementBuilder->buildProp() (Line: 68)
Drupal\ui_patterns\Element\ComponentElementBuilder->buildProps() (Line: 49)
Drupal\ui_patterns\Element\ComponentElementBuilder->build()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 44)
__TwigTemplate_cde85cbeced03ad7304f0b171ffab65b->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 244)
__TwigTemplate_f8bf2811b71e722f6934d6c00224e74b->{closure}() (Line: 2058)
Twig\Extension\CoreExtension::captureOutput() (Line: 213)
__TwigTemplate_f8bf2811b71e722f6934d6c00224e74b->macro_content() (Line: 191)
__TwigTemplate_f8bf2811b71e722f6934d6c00224e74b->{closure}() (Line: 2058)
Twig\Extension\CoreExtension::captureOutput() (Line: 119)
__TwigTemplate_f8bf2811b71e722f6934d6c00224e74b->macro_field() (Line: 87)
__TwigTemplate_f8bf2811b71e722f6934d6c00224e74b->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 86)
__TwigTemplate_99eb390ab14c963e3444974959882998->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 141)
__TwigTemplate_954931822877dc81be93f06e93d55692___1923388244->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 44)
__TwigTemplate_954931822877dc81be93f06e93d55692->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 234)
Drupal\Core\Template\TwigEnvironment->renderInline() (Line: 54)
Drupal\Core\Render\Element\InlineTemplate::preRenderInlineTemplate()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 44)
__TwigTemplate_cde85cbeced03ad7304f0b171ffab65b->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 152)
__TwigTemplate_ef1cca93ddabfd78517b1af3bd9a2b55->block_content() (Line: 431)
Twig\Template->yieldBlock() (Line: 89)
__TwigTemplate_ef1cca93ddabfd78517b1af3bd9a2b55->block_wrapper() (Line: 431)
Twig\Template->yieldBlock() (Line: 53)
__TwigTemplate_ef1cca93ddabfd78517b1af3bd9a2b55->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 178)
__TwigTemplate_d1ef5f3fac6f7f4a2af1062d6553c292->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 128)
__TwigTemplate_601f39d425a21b830fcca07f8589f81f->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Dale is using paragraphs (so entity reference revisions) and display suite (without ui_patterns_ds, so without the specific "DS Field" plugins).

More info in this Slack thread: https://drupal.slack.com/archives/C03MFN4D40J/p1736788312484209 (which is also dealing with #3499625: [2.0.0-rc2] Missing source for field prop entity to get access to the entity referenced by field items in the context of component per item field formatter

Proposed resolution

  1. Try to reproduce the error.
  2. Fix it.
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

pdureau created an issue. See original summary.

dalemoore’s picture

Here are my steps to reproduce. Some in the first steps sub-bullets may not be needed but including?

  1. You will need some SDCs to use. I have a parent SDC called Social Links and a child one called Social Link. (@pdureau should already have these, they were included in the Slack conversation)
  2. Make sure you have Display Suite and Display Suite Extras installed. This is used to select a component layout within Manage Display. Under Display Suite (admin/structure/ds/settings), I have these settings:
    • Enable field templates
    • Enable field templates in Layout Builder
    • Default Field Template: Expert
    • Under Extra fields, nothing selected
    • Under Other, "Use field names in templates" and "Exclude Display Suite Layouts in Layout Builder" are checked"
    • Nothing checked in BC settings
  3. Create a paragraph type (in my case, it's called Social Link - this is the child component) and add whatever fields you want to it, including at least one Entity Reference field (I have a taxonomy term one called Network that references social network names, e.g., Facebook, Instagram, etc.).
  4. Create a block type (in my case, it's called Social Links - this is the parent component) and add whatever fields you want, including one Entity Reference Revisions/Paragraphs field that uses the previously-created paragraph type.
  5. Go ahead and add an instance of the block somewhere on your page in a region (I'm not using Layout Builder here, just the block UI).
  6. Under Manage Display for the block type, make sure it's set to "Referenced entity" under Format for the Entity Reference Revisions field. Under "Current layout" choose the parent SDC from the dropdown list and save. That's all you need here.
  7. Under Manage Display for the paragraph type, with Display Suite installed, under "Current layout" select the SDC you want to use from the dropdown list (for me, it is the child component Social Link) and save.
  8. Go to "Layout settings" still in the paragraph type, and map the props to the appropriate fields. The only options to start are "Data from a field" or "Referenced entities", there is no initial "Prop: entity" available like there is when using "Components per item" in the sibling issue. I choose "Data from a field" for each.
  9. Once all fields are mapped, save, then go back and refresh the page to view your block.
  10. I get a ContextException error message.

Sending a video of the steps in Slack.

just_like_good_vibes’s picture

Thanks for reporting.
After investigation, this error occurs when using the contrib module ds, when a layout from ui patterns is configured in a content entity display (here a paragraph), and in the layout settings, a source with the current entity is used.
it works in form configuration, but fails to properly render.
Indeed, for the moment, ui_patterns module is not providing itself a way to guess the current entity inside ds_entity_view layout options.

pdureau’s picture

Assigned: Unassigned » just_like_good_vibes
Status: Active » Needs work

Indeed, for the moment, ui_patterns module is not providing itself a way to guess the current entity inside ds_entity_view layout options

UI Patterns target both Core & contrib modules, but we target by default only Core plugin types: Blocks, Layouts, Formatters...

Display Suite is using both:

  • core plugin types (Layout for example) and it is supposed to work directly with ui_patterns_layouts sub-module if the usage of Dsipaly Suite is a "normal" (no weird additions or alteration)
  • a custom plugin type ("DS Field"), for this one, ui_patterns_ds is needed

So, are we 100% sure it is not working because of DS?

  • If yes,
  • If not, we need to tweak something in our codebase.

So, anyway, it seems there is something to do for the RC2.

dalemoore’s picture

a custom plugin type ("DS Field"), for this one, ui_patterns_ds is needed

To my knowledge I'm not using a DS Field, but I could be wrong. Would I have to select one of these options in the layout dropdown under Manage Display to do something like that?

Screenshot of Display Suite layout options

Or, this option would need to be enabled maybe:

A screenshot of Display Suite UI

Or something on this screen?

A screenshot of Display Suite UI

I'm not sure what exactly a DS Field is, I haven't used the things found in the last two screenshots before. In the past I would only use what's in the first screenshot, which allows me to override the template, add attributes/classes to fields, etc.

The only thing I'm using DS in this case is to select an SDC on the Manage Display screen layout dropdown without having to rely on Layout Builder (because I don't wish to manipulate layout visually, just do mapping to the SDC) or Field Layout (this module is to be deprecated and will be removed from Core, see this issue, this issue, and this issue). I haven't tried using Field Layout before, but I just did on a separate bare Drupal install. It doesn't seem to offer the ability to control field layout under "Manage display" any more, only under "Manage form display", so using Field Layout instead of Display Suite won't work.

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » pdureau
Status: Needs work » Needs review
just_like_good_vibes’s picture

For the moment, let's catch context exceptions and send a message to drupal logs...

pdureau’s picture

Assigned: pdureau » just_like_good_vibes
Status: Needs review » Reviewed & tested by the community

The change is great, thanks.

Before merging and closing the issue, we need to create the related issue in https://www.drupal.org/project/issues/ui_patterns_ds

Do you want to do it?

pdureau’s picture

Assigned: just_like_good_vibes » duaelfr
Status: Reviewed & tested by the community » Needs review

issue created #3501396: ContextException with entity

Duael is currently testing with Field Layout

duaelfr’s picture

Assigned: duaelfr » Unassigned
Status: Needs review » Needs work

I have a similar issue with the following steps to reproduce (also reproduced by @g4mbini on a clean install):

  1. Enable Field Layout
  2. Have a SDC with a string prop
  3. In the manage display form of one of your node types, in the layout settings section, select your SDC
  4. In the props settings, for your prop select "Referenced entities" the any referenced entity then any option in the Source select
  5. Save your settings to see the error

I applied the patch from the MR and I'm still able to reproduce.
Here is my stack trace:

Drupal\Component\Plugin\Exception\ContextException: The 'entity:node' context is required and not present. in Drupal\Core\Plugin\Context\Context->getContextValue() (line 73 of core/lib/Drupal/Core/Plugin/Context/Context.php).

Drupal\ui_patterns\Plugin\UiPatterns\DerivableContext\EntityReferencedDerivableContext->getDerivedContexts() (Line: 124)
Drupal\ui_patterns\Plugin\UiPatterns\Source\DerivableContextSourceBase->getSourcePlugins() (Line: 470)
Drupal\ui_patterns\Plugin\UiPatterns\Source\DerivableContextSourceBase->calculateDependencies() (Line: 264)
Drupal\ui_patterns\Element\ComponentElementBuilder->calculateComponentDependenciesProps(Object, Array, Array) (Line: 238)
Drupal\ui_patterns\Element\ComponentElementBuilder->calculateComponentDependencies('ccu_theme:card_highlight', Array, Array) (Line: 234)
Drupal\ui_patterns_layouts\Plugin\Layout\ComponentLayout->calculateComponentDependencies('ccu_theme:card_highlight', Array) (Line: 170)
Drupal\ui_patterns_layouts\Plugin\Layout\ComponentLayout->calculateDependencies() (Line: 71)
Drupal\Core\Config\Entity\ConfigEntityBase->getPluginDependencies(Object) (Line: 89)
Drupal\Core\Config\Entity\ConfigEntityBase->calculatePluginDependencies(Object) (Line: 149)
Drupal\field_layout\Entity\FieldLayoutEntityViewDisplay->calculateDependencies() (Line: 328)
Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object) (Line: 272)
Drupal\Core\Entity\EntityDisplayBase->preSave(Object) (Line: 114)
Drupal\field_layout\Entity\FieldLayoutEntityViewDisplay->preSave(Object) (Line: 528)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 239)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 617)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 293)
Drupal\Core\Entity\EntityForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 105)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 43)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder->processForm('entity_view_display_edit_form', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
pdureau’s picture

Assigned: Unassigned » just_like_good_vibes
just_like_good_vibes’s picture

expect an answer and new version very soon, within minutes :)

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » duaelfr
Status: Needs work » Needs review
just_like_good_vibes’s picture

would you test please ?

just_like_good_vibes’s picture

i just added some more fixes..

dalemoore’s picture

I tried the updated code as a patch (alongside the other issue's code which I still have patched in), switching my 'Social Links' component to use 'Rendered entity' instead of 'Components per item', then in the paragraph type mapping the fields to the props. Instead of the ContextException I now get this:

The website encountered an unexpected error. Try again later.

Error: Call to a member function get() on null in Drupal\ui_patterns\Plugin\UiPatterns\Source\FieldPropertySource->getPropValue() (line 33 of modules/contrib/ui_patterns/src/Plugin/UiPatterns/Source/FieldPropertySource.php).

Drupal\ui_patterns\SourcePluginBase->getValue() (Line: 98)
Drupal\ui_patterns\Plugin\UiPatterns\Source\DerivableContextSourceBase->getPropValue() (Line: 199)
Drupal\ui_patterns\SourcePluginBase->getValue() (Line: 91)
Drupal\ui_patterns\Element\ComponentElementBuilder->buildProp() (Line: 71)
Drupal\ui_patterns\Element\ComponentElementBuilder->buildProps() (Line: 52)
Drupal\ui_patterns\Element\ComponentElementBuilder->build()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 44)
__TwigTemplate_9fd84133cf2adb9e74cfdc062566cfd5->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 244)
__TwigTemplate_bc21571d82fec26cc5a2a823aa2651a1->{closure}() (Line: 2058)
Twig\Extension\CoreExtension::captureOutput() (Line: 213)
__TwigTemplate_bc21571d82fec26cc5a2a823aa2651a1->macro_content() (Line: 191)
__TwigTemplate_bc21571d82fec26cc5a2a823aa2651a1->{closure}() (Line: 2058)
Twig\Extension\CoreExtension::captureOutput() (Line: 119)
__TwigTemplate_bc21571d82fec26cc5a2a823aa2651a1->macro_field() (Line: 87)
__TwigTemplate_bc21571d82fec26cc5a2a823aa2651a1->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 86)
__TwigTemplate_3150cca8781d01d314c0ea2fc77e4d3e->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 165)
__TwigTemplate_f755c51af21e4ba003b7403eadf7f91a___59522040->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 44)
__TwigTemplate_f755c51af21e4ba003b7403eadf7f91a->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 234)
Drupal\Core\Template\TwigEnvironment->renderInline() (Line: 54)
Drupal\Core\Render\Element\InlineTemplate::preRenderInlineTemplate()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 44)
__TwigTemplate_9fd84133cf2adb9e74cfdc062566cfd5->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 152)
__TwigTemplate_bc05fafc2639a509ad8ac530045c2abd->block_content() (Line: 431)
Twig\Template->yieldBlock() (Line: 89)
__TwigTemplate_bc05fafc2639a509ad8ac530045c2abd->block_wrapper() (Line: 431)
Twig\Template->yieldBlock() (Line: 53)
__TwigTemplate_bc05fafc2639a509ad8ac530045c2abd->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 178)
__TwigTemplate_00e51af2befcc5fa6f56f8cd1ffdd83c->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 128)
__TwigTemplate_31cd56f2962c65fbb44761101472ce3c->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 176)
Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->makeSubrequest() (Line: 119)
Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber->makeSubrequestToCustomPath() (Line: 81)
Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber->on404() (Line: 109)
Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase->onException()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 239)
Symfony\Component\HttpKernel\HttpKernel->handleThrowable() (Line: 91)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Oh, and upon first integrating the patch and running composer update, I get this error until I do drush cr to clear caches:

The website encountered an unexpected error. Try again later.

ArgumentCountError: Too few arguments to function Drupal\ui_patterns\Element\ComponentElementBuilder::__construct(), 3 passed in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 and exactly 4 expected in Drupal\ui_patterns\Element\ComponentElementBuilder->__construct() (line 34 of modules/contrib/ui_patterns/src/Element/ComponentElementBuilder.php).

Drupal\Component\DependencyInjection\Container->createService() (Line: 179)
Drupal\Component\DependencyInjection\Container->get() (Line: 33)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 100)
Drupal\Core\Utility\CallableResolver->getCallableFromDefinition() (Line: 863)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 44)
__TwigTemplate_9fd84133cf2adb9e74cfdc062566cfd5->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 152)
__TwigTemplate_bc05fafc2639a509ad8ac530045c2abd->block_content() (Line: 431)
Twig\Template->yieldBlock() (Line: 89)
__TwigTemplate_bc05fafc2639a509ad8ac530045c2abd->block_wrapper() (Line: 431)
Twig\Template->yieldBlock() (Line: 53)
__TwigTemplate_bc05fafc2639a509ad8ac530045c2abd->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 178)
__TwigTemplate_00e51af2befcc5fa6f56f8cd1ffdd83c->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 128)
__TwigTemplate_31cd56f2962c65fbb44761101472ce3c->doDisplay() (Line: 387)
Twig\Template->yield() (Line: 343)
Twig\Template->display() (Line: 358)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 176)
Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->makeSubrequest() (Line: 119)
Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber->makeSubrequestToCustomPath() (Line: 81)
Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber->on404() (Line: 109)
Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase->onException()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 239)
Symfony\Component\HttpKernel\HttpKernel->handleThrowable() (Line: 91)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

just_like_good_vibes’s picture

more goodness pushed :)

pdureau’s picture

Assigned: duaelfr » Unassigned
Status: Needs review » Reviewed & tested by the community
  1. Fresh Drupal isntall
  2. Enable Field Layout, UI Patterns 2 and UI Suite DSFR theme
  3. In /admin/structure/types/manage/article/display select the UI Suite DSFR alert component as a layout
  4. For the "Close button text" prop (string), select "Referenced entities" then any referenced entity then any field
  5. Save your settings and check the full page of an article

It works well. The data is retrieved and send to the prop.

Sounds great, no? However all this was done without switching to the MR branch! Maybe one of the many fix we did today was also fixing this issue.

pdureau’s picture

Title: [2.0.0-rc2] ContextException with entity:paragraph » [2.0.0-rc2] Entity ContextException with ComponentLayout

So, what do we do? We merge or we cancel this MR?

pdureau’s picture

Assigned: Unassigned » just_like_good_vibes
Status: Reviewed & tested by the community » Needs review

Or maybe it is a DS specific issue? I have tested only with Field Layout

just_like_good_vibes’s picture

For Display suite users, one can look at the solution shown in that issue. It will be implemented in the future in ui_patterns_ds module.

just_like_good_vibes’s picture

just_like_good_vibes’s picture

Assigned: christian.wiedemann » Unassigned
Status: Needs review » Fixed
duaelfr’s picture

I woke up this morning to see this fixed.
Congratulations and many thanks for this!!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.