After installing Easy Breadcrumb on our project the Page Manager UI got broken.

When using both contrib modules:

  • Easy Breadcrumb 8.x-1.8
  • Page Manger 8.x-4.0-beta3

I can not work with Page Manager UI as I'm getting 500 error (The website encountered an unexpected error. Please try again later.) on pages like this: /admin/structure/page_manager/manage/test_page/content

The problem is that the Easy Breadcrumb is trying to get Page Manager's page title, but it somehow provides a context in which Page Manager calls

return $this->t('Edit %label page', ['%label' => $page->label()]);

but the $page is null.

I'm not sure if it is bug in Easy Breadcrumb or Page Manager not being careful enough and using $page variable loaded from cached values:

    $cached_values = $this->tempstore->get($tempstore_id)->get($machine_name);
    /** @var \Drupal\page_manager\PageInterface $page */
    $page = $cached_values['page'];

even though it might be null, so I'm mirroring this issue in Easy Bredcrumb issue queue too: https://www.drupal.org/project/easy_breadcrumb/issues/3052340

Reported error:
Error: Call to a member function label() on null in Drupal\page_manager_ui\Controller\PageManagerController->editPageTitle() (line 115 of /app/web/modules/contrib/page_manager/page_manager_ui/src/Controller/PageManagerController.php)

Call stack

  1. PageManagerController.php:115, Drupal\page_manager_ui\Controller\PageManagerController->editPageTitle()
  2. TitleResolver.php:58, call_user_func_array:{/app/web/core/lib/Drupal/Core/Controller/TitleResolver.php:58}()
  3. TitleResolver.php:58, Drupal\Core\Controller\TitleResolver->getTitle()
  4. EasyBreadcrumbBuilder.php:346, Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->getTitleString()
  5. EasyBreadcrumbBuilder.php:234, Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->build()
  6. BreadcrumbManager.php:83, Drupal\Core\Breadcrumb\BreadcrumbManager->build()
  7. SystemBreadcrumbBlock.php:72, Drupal\system\Plugin\Block\SystemBreadcrumbBlock->build()
  8. BlockViewBuilder.php:203, Drupal\block\BlockViewBuilder::preRender()
  9. Renderer.php:378, call_user_func:{/app/web/core/lib/Drupal/Core/Render/Renderer.php:378}()
  10. Renderer.php:378, Drupal\Core\Render\Renderer->doRender()
  11. Renderer.php:450, Drupal\Core\Render\Renderer->doRender()
  12. Renderer.php:195, Drupal\Core\Render\Renderer->render()
  13. TwigExtension.php:490, Drupal\Core\Template\TwigExtension->escapeFilter()
  14. 16:71, __TwigTemplate_127c79ddd881ab7b6bf51c9cb210f022fdb02a2a8c8d0c0e159772c2c8082496->doDisplay()
  15. Template.php:430, __TwigTemplate_127c79ddd881ab7b6bf51c9cb210f022fdb02a2a8c8d0c0e159772c2c8082496->displayWithErrorHandling()
  16. Template.php:401, __TwigTemplate_127c79ddd881ab7b6bf51c9cb210f022fdb02a2a8c8d0c0e159772c2c8082496->display()
  17. Template.php:409, __TwigTemplate_127c79ddd881ab7b6bf51c9cb210f022fdb02a2a8c8d0c0e159772c2c8082496->render()
  18. twig.engine:64, twig_render_template()
  19. ThemeManager.php:384, Drupal\Core\Theme\ThemeManager->render()
  20. Renderer.php:437, Drupal\Core\Render\Renderer->doRender()
  21. Renderer.php:195, Drupal\Core\Render\Renderer->render()
  22. TwigExtension.php:490, Drupal\Core\Template\TwigExtension->escapeFilter()
  23. 16:102, __TwigTemplate_f19c0879957c7fb8321dfff4e362d29f4923d893ee6247a1d6d99370c9ca7785->doDisplay()
  24. Template.php:430, __TwigTemplate_f19c0879957c7fb8321dfff4e362d29f4923d893ee6247a1d6d99370c9ca7785->displayWithErrorHandling()
  25. Template.php:401, __TwigTemplate_f19c0879957c7fb8321dfff4e362d29f4923d893ee6247a1d6d99370c9ca7785->display()
  26. Template.php:409, __TwigTemplate_f19c0879957c7fb8321dfff4e362d29f4923d893ee6247a1d6d99370c9ca7785->render()
  27. twig.engine:64, twig_render_template()
  28. ThemeManager.php:384, Drupal\Core\Theme\ThemeManager->render()
  29. Renderer.php:437, Drupal\Core\Render\Renderer->doRender()
  30. Renderer.php:195, Drupal\Core\Render\Renderer->render()
  31. HtmlRenderer.php:147, Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
  32. Renderer.php:582, Drupal\Core\Render\Renderer->executeInRenderContext()
  33. HtmlRenderer.php:148, Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
  34. MainContentViewSubscriber.php:90, Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
  35. ContainerAwareEventDispatcher.php:111, call_user_func:{/app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php:111}()
  36. ContainerAwareEventDispatcher.php:111, Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
  37. HttpKernel.php:156, Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  38. HttpKernel.php:68, Symfony\Component\HttpKernel\HttpKernel->handle()
  39. Session.php:57, Drupal\Core\StackMiddleware\Session->handle()
  40. KernelPreHandle.php:47, Drupal\Core\StackMiddleware\KernelPreHandle->handle()
  41. PageCache.php:99, Drupal\page_cache\StackMiddleware\PageCache->pass()
  42. PageCache.php:78, Drupal\page_cache\StackMiddleware\PageCache->handle()
  43. ReverseProxyMiddleware.php:47, Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
  44. NegotiationMiddleware.php:52, Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
  45. StackedHttpKernel.php:23, Stack\StackedHttpKernel->handle()
  46. DrupalKernel.php:693, Drupal\Core\DrupalKernel->handle()
  47. index.php:19, {main}()
CommentFileSizeAuthor
#8 Screen Shot 2022-07-03 at 3.39.02 PM.png31.78 KBfskreuz

Comments

dabbor created an issue. See original summary.

manuel.adan’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce it with the default configuration in a fresh install with standard profile. It still happen after a cache rebuilt?. You could try to isolate the issue in a fresh install only with the modules you are using that could be involved on it.

greg boggs’s picture

Here's a link to a simply test me site with the bug replicated which should be up for the next day or so:

https://d0ey4.ply.st/admin/structure/page_manager/manage/test_page/content

To get the error, you actually need to enable Easy Breadcrumb "Use Real Title" feature. I've considered turning this feature on by default, because most people use it, but I haven't made the change.

manuel.adan’s picture

Status: Postponed (maintainer needs more info) » Active

All right, I'll take a look into it.

manuel.adan’s picture

Updating to the latest -dev version of page_manager it works. I didn't determine the exact cause, but it seems to be related to #3033057: Page Manager currently not working with CTools 3.1+, that is currently fixed and committed. As soon as some other ongoing issues get fixed, a new beta will be release. Please, if updating to -dev solves it for you, close as won't fix.

greg boggs’s picture

You rock!

manuel.adan’s picture

Status: Active » Closed (cannot reproduce)
fskreuz’s picture

Status: Closed (cannot reproduce) » Active
StatusFileSize
new31.78 KB

I can reproduce the error. Steps to reproduce:

1. Install the following modules at these specific versions
- page_manager 4.0-beta6
- ctools 3.8
- easy_breadcrumb 2.0.3
2. For Easy Breadcrumb config, do the following:
- uncheck
- Use the real page title when available
- check
- Use menu title when available
- Use page title as fallback for menu title
3. Create a page manager page all the way until you complete the creation wizard. Only then you get the error.

The issue is caused by ctools. Flip ctools back to 3.7 and the issue goes away. The problem is that somewhere in the 3.8 update, it flipped from shared tempstore to private tempstore. The stored entry's key also changed, now having a prefix that I could not find the source right now. Both these cause the returned cached item to be NULL when it shouldn't be.

The quick fix is to roll back ctools to 3.7. Unsure whether it's a ctools bug or page_manager needing some tweaking Traced it back to this issue where ctools switched from shared tempstore to private tempstore to avoid multiple users editing the same thing. Fix probably needs to be on page_manager, but unsure how to go about it.

rudi teschner’s picture

Im getting the same error when having modules up2date when editing a page - and reversing the patch fskreuz linked makes the error go away, so he is probably right about it.

travisc’s picture

confirmed, rollback is the quick fix for now.

vacho’s picture

Also you can upgrade ctools to last version and this works for me:

Check which version you need, and upgrade.

/var/www/html $ composer why drupal/ctools
drupal/ctools_block      4.0.0       requires drupal/ctools (*)       
drupal/ctools_views      3.8.0       requires drupal/ctools (^3)      
drupal/page_manager      4.0.0-beta6 requires drupal/ctools (^3.1)    
drupal/panelizer         4.4.0       requires drupal/ctools (>=3.1.0) 
drupal/panels            4.6.0       requires drupal/ctools (>=3.0.0) 
drupal/panels_everywhere 4.0.0-beta2 requires drupal/ctools (>=3.0.0) 
drupal/password_policy   3.1.0       requires drupal/ctools (^3.1)    
drupal/pathauto          1.10.0      requires drupal/ctools (*)       

/var/www/html $ composer require drupal/ctools:^3.7
japerry’s picture

Status: Active » Closed (outdated)

We reverted the privateTempstore feature in ctools, so this should be fixed.