Problem/Motivation

I upgraded from LP 3-beta4 to LP 3.0.0, ran the update db and exported config. When attempting to edit a node I immediately got an error:

InvalidArgumentException: No component found with UUID . in Drupal\layout_paragraphs\LayoutParagraphsLayout->getComponentByUuid() (line 323 of /var/www/html/docroot/modules/contrib/layout_paragraphs/src/LayoutParagraphsLayout.php).

#0 /var/www/html/docroot/modules/contrib/mercury_editor/modules/mercury_editor_templates/src/EventSubscriber/LayoutParagraphsAllowedTypesSubscriber.php(71): Drupal\layout_paragraphs\LayoutParagraphsLayout->getComponentByUuid()
#1 [internal function]: Drupal\mercury_editor_templates\EventSubscriber\LayoutParagraphsAllowedTypesSubscriber->addTemplates()
#2 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#3 /var/www/html/docroot/modules/contrib/layout_paragraphs/src/Element/LayoutParagraphsBuilder.php(740): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#4 /var/www/html/docroot/modules/contrib/layout_paragraphs/src/Element/LayoutParagraphsBuilder.php(688): Drupal\layout_paragraphs\Element\LayoutParagraphsBuilder->getAllowedTypes()
#5 /var/www/html/docroot/modules/contrib/layout_paragraphs/src/Element/LayoutParagraphsBuilder.php(390): Drupal\layout_paragraphs\Element\LayoutParagraphsBuilder->convertAccess()
#6 /var/www/html/docroot/modules/contrib/layout_paragraphs/src/Element/LayoutParagraphsBuilder.php(214): Drupal\layout_paragraphs\Element\LayoutParagraphsBuilder->buildComponent()
#7 [internal function]: Drupal\layout_paragraphs\Element\LayoutParagraphsBuilder->preRender()
#8 /var/www/html/docroot/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(113): call_user_func_array()
#9 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(886): Drupal\Core\Render\Renderer->doTrustedCallback()
#10 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Render\Renderer->doCallback()
#11 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(503): Drupal\Core\Render\Renderer->doRender()
#12 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#13 /var/www/html/docroot/core/lib/Drupal/Core/Template/TwigExtension.php(513): Drupal\Core\Render\Renderer->render()
#14 /var/www/html/vendor/twig/twig/src/Environment.php(434) : eval()'d code(116): Drupal\Core\Template\TwigExtension->escapeFilter()
#15 /var/www/html/vendor/twig/twig/src/Template.php(461): __TwigTemplate_a2db4d569596e5e998f4d959fc4f7ac6->doDisplay()
#16 /var/www/html/vendor/twig/twig/src/Template.php(416): Twig\Template->yield()
#17 /var/www/html/vendor/twig/twig/src/Template.php(431): Twig\Template->display()
#18 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(53): Twig\Template->render()
#19 /var/www/html/docroot/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render()
#20 /var/www/html/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template()
#21 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(490): Drupal\Core\Theme\ThemeManager->render()
#22 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#23 /var/www/html/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render()
#24 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(637): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#25 /var/www/html/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(231): Drupal\Core\Render\Renderer->executeInRenderContext()
#26 /var/www/html/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#27 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#28 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#29 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#30 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#31 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#32 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#33 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#34 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#35 /var/www/html/docroot/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#36 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#37 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#38 /var/www/html/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle()
#39 /var/www/html/docroot/modules/contrib/markdownify/src/StackMiddleware/MarkdownifyNegotiationMiddleware.php(45): Asm89\Stack\Cors->handle()
#40 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\markdownify\StackMiddleware\MarkdownifyNegotiationMiddleware->handle()
#41 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#42 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#43 /var/www/html/docroot/modules/contrib/mercury_editor/src/StackMiddleware/AjaxPageState.php(38): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#44 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\mercury_editor\StackMiddleware\AjaxPageState->handle()
#45 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#46 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()
#47 {main}

Steps to reproduce

I simply clicked to edit a node after the update. I'm also have Mercury Editor 3.0-beta4 and style options 1.1.1 and Drupal 10.6.19. If there is any data I can provide, please let me know.

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

shelane created an issue. See original summary.

minoroffense’s picture

The layout paragraphs limit module has a similar problem. The parent_uuid is empty and then the getComponentByUuid just dies.

We hotfixed layout paragraphs limit with which may require something similar in mercury editor. Or the getComponentByUuid method should handle empty uuid strings better.

diff --git a/src/EventSubscriber/LayoutParagraphsLimitAllowedTypesSubscriber.php b/src/EventSubscriber/LayoutParagraphsLimitAllowedTypesSubscriber.php
index 9103293..5a243a5 100644
--- a/src/EventSubscriber/LayoutParagraphsLimitAllowedTypesSubscriber.php
+++ b/src/EventSubscriber/LayoutParagraphsLimitAllowedTypesSubscriber.php
@@ -49,6 +49,9 @@ class LayoutParagraphsLimitAllowedTypesSubscriber implements EventSubscriberInte
    */
   public function typeRestrictions(LayoutParagraphsAllowedTypesEvent $event): void {
     $parent_uuid = $event->getParentUuid();
+    if (empty($parent_uuid)) {
+      return ;
+    }
     $region = $event->getRegion();
     $parent = $event->getLayout()->getComponentByUuid($parent_uuid);
     if (!$parent) {

justin2pin made their first commit to this issue’s fork.

justin2pin’s picture

Status: Active » Fixed

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.

Status: Fixed » Closed (fixed)

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