- 🇦🇺Australia alex.skrypnyk Melbourne
This is potentially related to https://www.drupal.org/project/drupal/issues/2860346 🐛 Reset plugin discovery when a module/theme is installed Needs work
The definitions are cached during a theme install.
If a theme provides custom layouts and has configuration objects that use those layouts (like `entity_view_display`), the layouts plugin definitions will already be cached and newly installed layouts will not have a chance to be discovered during the process of the theme installation.
Adding a cache tag that depends on installed extensions resolve this issue.
In LayoutPluginManager:
$this->setCacheBackend($cache_backend, $type, ['config:core.extension']);
Patch attached.
- 🇧🇪Belgium herved
For me #20 doesn't work.
I have a theme that is already installed, and some configs using it (in config_sync).
When I change a layout machine name and attempt to clear cache and config import, it fails.
#16 and #3 are working though. - 🇨🇭Switzerland boregar
#20 worked for me on a fresh install with CivicTheme 1.6.2 on Drupal Core 10.2.3. Thanks!
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
I used patch #20 on Drupal 10.3.0 and CivicTheme 1.7.1 and the fatal error went away.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
It would be great if someone wanted to review the different approach in #20, update the issue summary, and add tests :)
- First commit to issue fork.
- Merge request !11040[3204271] Added support to fix Layout builder cannot recover on missing layout → (Open) created by joshua1234511
- First commit to issue fork.
- 🇮🇳India anjaliprasannan
@joshua1234511 The test is failing in the pipeline. I tried it in the local by following the test steps where I could not find a message as in the test case. Is the test written as per requirement? Should the test be rewrorked on?
- Status changed to Needs review
about 2 months ago 3:05pm 7 May 2025 - 🇮🇳India joshua1234511 Goa
Reverted the added test. Mock tests are complex to integrate into the layout build scenario for scenario-based execution. Manual testing is required for this fix.
- 🇺🇸United States smustgrave
Going to disagree that we should have test coverage added but will leave in review.
- 🇳🇿New Zealand danielveza Brisbane, AU
This absolutely needs test coverage.
I haven't thoroughly looked into this issue yet, would it would to have a test module that provides a layout, add that layout to a page, then uninstall that module and verify everything still works as expected? If I get a chance I'll look into this.
- 🇳🇿New Zealand danielveza Brisbane, AU
I've added test coverage, and also fixed issues where this wasn't working on the default layout or on nodes that did not have overridden layouts (Yay for tests)
Lets see how the pipeline goes here. I'm a little iffy of how many places we are calling ->hasLayout. I wonder if we can put that in a central place instead.
- 🇳🇿New Zealand danielveza Brisbane, AU
Test coverage added and tests are green. I'd be interested to get a second set up eyes on this one. Mainly around this comment.
I'm a little iffy of how many places we are calling ::hasLayout. I wonder if we can put that in a central place instead.
I get this error when installing the new Navigation module. (I'm not using any patches for this issue)
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "navigation_layout" plugin does not exist.
This issue is prohibiting me from converting my site to the new module.
I applied the MR diff as a patch to my Drupal 10.4 site, and I still get the error.
Let me know if you need me to provide a stack trace or anything else.
- First commit to issue fork.
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
I made an addition in getLayoutSettings to avoid it to fail if the layout plugin does not exist.
This is helpful in case of update like for UI Patterns 1 to UI Patterns 2 upgrade.
Attaching patch for Composer usage.