Immediately after enabling menu_item_extras for the first time and then adding a menu link in Main navigation, when I hit the Save button I got "The website encountered an unexpected error. Please try again later."
Update: I think Layout Builder was enabled.
And this is the error I saw in the watchdog:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:menu_link_content:main" plugin does not exist. Valid plugin IDs for Drupal\Core\TypedData\TypedDataManager are: (...long list of plugins...) in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /var/www/drupalvm/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
I cleared caches using Drush. Successfully went back to the home page. Then back to admin/structure/menu/manage/main where I saved without making any changes and, finally, I was able to add a menu link, no error this time, all seems normal as if now the system was aware of the plugin that it was initially complaining about.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3061342-07-not-found-plugin_1.patch | 1.75 KB | ozin |
Issue fork menu_item_extras-3061342
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
volegerThanks for STR. The error was reproduced.
I had attached the test coverage. So we need to fix the test.
Comment #3
bisonbleu commentedNote: I think Layout Builder was enabled when I added the link that caused this php error. Adding a note in the issue summary in case this is relevant.
Comment #4
jeffamI ran into a similar error when I tried to add a link to a programmatically created menu.
The menus are created with code something like this:
When I try to save a link to the menu, I get the following.
Clearing caches allows me to save links to the menu without further errors.
Comment #5
jeffamSince flushing all of the caches prevents the error, I looked through
drupal_flush_all_caches()and, based on what happens in there, I found that the following can be run after a programmatically-created menu is saved:This prevents the
PluginNotFoundExceptionerror from theTypedDataManagerwhen I later try to add a menu link to the new menu.Comment #6
daveferrara1 commentedWe have a similar issue where we get this error if we create a new menu and then immediately use the the add link button. When we attempt to save the new link, we receive the Drupal\Component\Plugin\Exception\PluginNotFoundException. Likely similar to https://www.drupal.org/node/2773591 where we need cache emptied. Here is a small patch to do it if we have a menu insert.
Comment #7
daveferrara1 commentedComment #8
sarathkmComment #9
marcoka commentedI can confirm this happening here too. I also canconfirm flushing the caches fixes this.
To reproduce i created a new menu and directly tried to add a link.
Comment #10
david.chevillet commentedI confirm the bug. The patch seems to fix it too, even if when creating a menu slow down a little bit the first link added, but we don't creat a menu every day. Thanks !
Comment #11
marchudson commentedI had the same issue described above which the patch fixed. But unfortunately it's back elsewhere.
Steps:
I installed the patch, flushed cache, created menu items successfully, selected some view modes on the VM Settings tab, added an (existing) field and finally I got the error after selecting label: "Hidden" on the Manage Display page.
Error (white screen o' death):
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "hidden" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: .....Comment #12
ivan ojiamboI ran into this error, clearing the cache helped me get rid of the error
Comment #15
ozinPlease check if the latest patch works for you.
Thanks!
Comment #16
tolu_ commented#15 works for me
Comment #17
ozin@tolu_ thanks for the review!
Comment #19
ozin