Fatal error on Manage Display page for non-Canvas view modes in Drupal CMS
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3571881. -->
Reported by: [ivan zugec](https://www.drupal.org/user/86970)
Related to !546
>>>
<h3 id="overview">Overview</h3>
<p>When visiting a view mode display page that isn't handled by a Canvas content template (e.g. Teaser, Search index), the page crashes.</p>
<p>Wasn't getting this error in 1.0.4.</p>
<p>Could be related to <a href="https://www.drupal.org/project/canvas/issues/3551709">https://www.drupal.org/project/canvas/issues/3551709</a></p>
<h3 id="steps-to-reproduce">Steps to reproduce</h3>
<p> 1. Install Canvas 1.1.0 (via Drupal CMS) on a site<br>
2. Have a content type with multiple view modes and not controlled by canvas.<br>
3. Navigate to that view mode's display page, e.g. `/admin/structure/types/manage/page/display/teaser`<br>
4. Page crashes with:</p>
<pre>The website encountered an unexpected error. Try again later.<br><br>Error: Call to a member function getLayoutBuilderUrl() on null in Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm->form() (line 66 of core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php).<br>Drupal\Core\Entity\EntityForm->buildForm() (Line: 40)<br>Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm->buildForm()<br>call_user_func_array() (Line: 554)<br>Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 303)<br>Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)<br>Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm() (Line: 243)<br>Drupal\Core\Form\FormBuilder->getForm() (Line: 61)<br>Drupal\canvas\Controller\ViewModeDisplayController->__invoke()<br>call_user_func_array() (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 634)<br>Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()<br>Fiber->start() (Line: 635)<br>Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)<br>Drupal\Core\StackMiddleware\Session->handle() (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118)<br>Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)<br>Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)<br>Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745)<br>Drupal\Core\DrupalKernel->handle() (Line: 19)</pre>
issue