Fatal error when "Use as title = Parent title at initial visibility level (visibility_level_parent)" and menuRoot is not initialized
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3576631. --> Reported by: [bspeare](https://www.drupal.org/user/2835299) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Selecting the new label type Parent title at initial visibility level (visibility_level_parent) can fatally break page render with this error: Error: Typed property Drupal\menu_block\Plugin\Block\MenuBlock::$menuRoot must not be accessed before initialization</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li><a href="https://simplytest.me/">https://simplytest.me/</a></li> <li>Choose menu_block and and 10.6.3 or 11.3.3</li> <li>Place a "Main navigation" menu block in /admin/structure/block content area</li> <li>Choose Parent title at initial visibility level (visibility_level_parent) as the title and save the block. </li> <li>Create a basic page and "Provide a menu link" and set the parent link to "-- Home"</li> <li>Save the page and you should see the error after refreshing the page. </li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue