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-&gt;form() (line 66 of core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php).<br>Drupal\Core\Entity\EntityForm-&gt;buildForm() (Line: 40)<br>Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm-&gt;buildForm()<br>call_user_func_array() (Line: 554)<br>Drupal\Core\Form\FormBuilder-&gt;retrieveForm() (Line: 303)<br>Drupal\Core\Form\FormBuilder-&gt;buildForm() (Line: 97)<br>Drupal\autosave_form\Form\AutosaveFormBuilder-&gt;buildForm() (Line: 243)<br>Drupal\Core\Form\FormBuilder-&gt;getForm() (Line: 61)<br>Drupal\canvas\Controller\ViewModeDisplayController-&gt;__invoke()<br>call_user_func_array() (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 634)<br>Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()<br>Fiber-&gt;start() (Line: 635)<br>Drupal\Core\Render\Renderer-&gt;executeInRenderContext() (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext() (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw() (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handle() (Line: 53)<br>Drupal\Core\StackMiddleware\Session-&gt;handle() (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle() (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength-&gt;handle() (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle() (Line: 118)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;pass() (Line: 92)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;handle() (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle() (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle() (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle() (Line: 54)<br>Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle() (Line: 745)<br>Drupal\Core\DrupalKernel-&gt;handle() (Line: 19)</pre>
issue