CuBoulder / ucb_migration_shortcodes

A module that works alongside the Shortcodes module to ease the burden of migration.
0 stars 0 forks source link

Button Shortcode Breaks Layout Builder #28

Closed jnicholCU closed 2 months ago

jnicholCU commented 2 months ago

Wendy was having a hard time saving her layout builder changes. On save she would get a forever spinner and nothing would happen. https://live-ucbdev-homepage.pantheonsite.io/node/400

Error log points to there being a problem with the button shortcode.

LogicException: A stray renderRoot() invocation is causing bubbling of attached assets to break. in Drupal\Core\Render\Renderer->renderRoot() (line 147 of /code/web/core/lib/Drupal/Core/Render/Renderer.php).
#0 /code/web/modules/custom/ucb_migration_shortcodes/src/Plugin/Shortcode/ButtonShortcode.php(76): Drupal\Core\Render\Renderer->renderRoot(Array)
CuBoulder/tiamat-theme#1 /code/web/modules/contrib/shortcode/src/ShortcodeService.php(438): Drupal\ucb_migration_shortcodes\Plugin\Shortcode\ButtonShortcode->process(Array, 'Find Courses')
CuBoulder/tiamat-theme#2 /code/web/modules/contrib/shortcode/src/ShortcodeService.php(315): Drupal\shortcode\ShortcodeService->processTag(Array, Array)
CuBoulder/tiamat-theme#3 /code/web/modules/contrib/shortcode/src/Plugin/Filter/Shortcode.php(78): Drupal\shortcode\ShortcodeService->process('<h3>Learn More<...', 'en', Object(Drupal\shortcode\Plugin\Filter\Shortcode))
CuBoulder/tiamat-theme#4 /code/web/core/modules/filter/src/Element/ProcessedText.php(118): Drupal\shortcode\Plugin\Filter\Shortcode->process('<h3>Learn More<...', 'en')
CuBoulder/tiamat-theme#5 [internal function]: Drupal\filter\Element\ProcessedText::preRenderText(Array)
CuBoulder/tiamat-theme#6 /code/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array(Array, Array)
CuBoulder/tiamat-theme#7 /code/web/core/lib/Drupal/Core/Render/Renderer.php(859): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
CuBoulder/tiamat-theme#8 /code/web/core/lib/Drupal/Core/Render/Renderer.php(421): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
CuBoulder/tiamat-theme#9 /code/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, false)
CuBoulder/tiamat-theme#10 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(475): Drupal\Core\Render\Renderer->render(Array)
CuBoulder/tiamat-theme#11 /code/vendor/twig/twig/src/Environment.php(360) : eval()'d code(82): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
CuBoulder/tiamat-theme#12 /code/vendor/twig/twig/src/Template.php(394): __TwigTemplate_ce214af345a84d7db41b1e938752f2c4->doDisplay(Array, Array)
CuBoulder/tiamat-theme#13 /code/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
CuBoulder/tiamat-theme#14 /code/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
CuBoulder/tiamat-theme#15 /code/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render(Array)
CuBoulder/tiamat-theme#16 /code/web/core/themes/engines/twig/twig.engine(39): Twig\TemplateWrapper->render(Array)
CuBoulder/tiamat-theme#17 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('core/themes/sta...', Array)
CuBoulder/tiamat-theme#18 /code/web/core/lib/Drupal/Core/Render/Renderer.php(480): Drupal\Core\Theme\ThemeManager->render('field', Array)
CuBoulder/tiamat-theme#19 /code/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)
CuBoulder/tiamat-theme#20 /code/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, false)
CuBoulder/tiamat-theme#21 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(577): Drupal\Core\Render\Renderer->render(Array)
CuBoulder/tiamat-theme#22 /code/vendor/twig/twig/src/Environment.php(360) : eval()'d code(63): Drupal\Core\Template\TwigExtension->renderVar(Array)
CuBoulder/tiamat-theme#23 /code/vendor/twig/twig/src/Template.php(394): __TwigTemplate_fb74e454ab34df27a1f279352bfefe84->doDisplay(Array, Array)
CuBoulder/tiamat-theme#24 /code/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
CuBoulder/tiamat-theme#25 /code/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
CuBoulder/tiamat-theme#26 /code/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render(Array)
CuBoulder/tiamat-theme#27 /code/web/core/themes/engines/twig/twig.engine(39): Twig\TemplateWrapper->render(Array)
CuBoulder/tiamat-theme#28 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/b...', Array)
CuBoulder/tiamat-theme#29 /code/web/core/lib/Drupal/Core/Render/Renderer.php(480): Drupal\Core\Theme\ThemeManager->render('block', Array)
CuBoulder/tiamat-theme#30 /code/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)
CuBoulder/tiamat-theme#31 /code/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, false)
CuBoulder/tiamat-theme#32 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(577): Drupal\Core\Render\Renderer->render(Array)
CuBoulder/tiamat-theme#33 /code/vendor/twig/twig/src/Environment.php(360) : eval()'d code(167): Drupal\Core\Template\TwigExtension->renderVar(Array)
CuBoulder/tiamat-theme#34 /code/vendor/twig/twig/src/Template.php(394): __TwigTemplate_4027c6b7f6319e3ab093ab0740cd0ac5->doDisplay(Array, Array)
CuBoulder/tiamat-theme#35 /code/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
CuBoulder/tiamat-theme#36 /code/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
CuBoulder/tiamat-theme#37 /code/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render(Array)
CuBoulder/tiamat-theme#38 /code/web/core/themes/engines/twig/twig.engine(39): Twig\TemplateWrapper->render(Array)
CuBoulder/tiamat-theme#39 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('modules/custom/...', Array)
CuBoulder/tiamat-theme#40 /code/web/core/lib/Drupal/Core/Render/Renderer.php(480): Drupal\Core\Theme\ThemeManager->render('layout__two_col...', Array)
CuBoulder/tiamat10-profile#90 /code/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)
CuBoulder/tiamat-theme#42 /code/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)
CuBoulder/tiamat-theme#43 /code/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)
CuBoulder/tiamat-theme#44 /code/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, true)
CuBoulder/tiamat-theme#45 /code/web/core/lib/Drupal/Core/Render/Renderer.php(153): Drupal\Core\Render\Renderer->render(Array, true)
CuBoulder/tiamat-theme#46 /code/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
CuBoulder/tiamat-theme#47 /code/web/core/lib/Drupal/Core/Render/Renderer.php(152): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
CuBoulder/tiamat-theme#48 /code/web/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php(36): Drupal\Core\Render\Renderer->renderRoot(Array)
CuBoulder/tiamat-theme#49 /code/web/core/lib/Drupal/Core/Ajax/ReplaceCommand.php(31): Drupal\Core\Ajax\InsertCommand->getRenderedContent()
CuBoulder/tiamat-theme#50 /code/web/core/lib/Drupal/Core/Ajax/AjaxResponse.php(43): Drupal\Core\Ajax\ReplaceCommand->render()
CuBoulder/tiamat-theme#51 /code/web/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php(47): Drupal\Core\Ajax\AjaxResponse->addCommand(Object(Drupal\Core\Ajax\ReplaceCommand))
CuBoulder/tiamat-theme#52 /code/web/modules/contrib/layout_builder_iframe_modal/src/Controller/RebuildController.php(61): Drupal\layout_builder_iframe_modal\Controller\RebuildController->rebuildLayout(Object(Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage))
CuBoulder/tiamat-theme#53 [internal function]: Drupal\layout_builder_iframe_modal\Controller\RebuildController->rebuild(Object(Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage))
CuBoulder/tiamat-theme#54 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
CuBoulder/tiamat-theme#55 /code/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
CuBoulder/tiamat-theme#56 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
CuBoulder/tiamat-theme#57 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
CuBoulder/tiamat-theme#58 /code/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
CuBoulder/tiamat-theme#59 /code/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
CuBoulder/tiamat-theme#60 /code/web/modules/custom/ucb_admin_menus/src/Middleware/Redirect403.php(47): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#61 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\ucb_admin_menus\Middleware\Redirect403->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#62 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#63 /code/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#64 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#65 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#66 /code/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#67 /code/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#68 /code/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
CuBoulder/tiamat-theme#69 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
CuBoulder/tiamat-theme#70 {main}
jnicholCU commented 2 months ago

The problem occurs in the Learn More text block with the Find Courses shortcode button.

image
jcsparks commented 2 months ago

Does this need to be done with shortcodes? This module was supposed to smooth over the migration issues - it was not supposed to be use for creating new content.

jnicholCU commented 2 months ago

No I let her know that if she switches it to all ckeditor buttons it's good. I think this problem will affect our migrated sites though. Ideally those migrated sites' editors then change to use ckeditor buttons fully but I don't think that will happen.

jnicholCU commented 2 months ago

I don't think this is super high prio though because the solution atm is "Don't use shortcodes"