Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey, I am experiencing a weird behavior on a fresh Drupal 8.1 install with multiversion enabled.
When I manually add a link to the main menu (/admin/structure/menu/manage/main) it is rendered twice in the admin interface AND on the front-end after clearing all caches.
I believe this effect is produced by the menu link storage. Anyone else seeing the same weirdness?
Comments
Comment #2
jeqqI can reproduce it. It duplicates internal links after cache clear. Working on a fix.
Comment #4
jeqqComment #5
djidane35 CreditAttribution: djidane35 commentedHi jeqq, I apply your changes :
- remove "$entity_type->setClass('Drupal\multiversion\Entity\MenuLinkContent');" in "multiversion.module" file
- remove "src/Entity/MenuLinkContent.php" file
and i reproduce yet the duplication. Are you sure that your fix is ok ?
Thanks in advance
Comment #6
jeqqThank you alexej_d and djidane35 for reporting and testing it. Reverted my commit and fixed this here.
Comment #7
djidane35 CreditAttribution: djidane35 commentedThanks jeqq, this seems to work !
Comment #9
djidane35 CreditAttribution: djidane35 commentedHi jeqq,
in fact your fix does not work when I use command "drush cr" wheras when i use link "Clear cache" from admin menu it works !
The problem is in "multiversion.module" file :
With drush, $menu_link_content_entities is empty whereas with link "Clear cache" from admin menu, entities are loaded.
I feel that something is not loaded when I pass by Drush, what do you think about this ?
Thanks
Comment #10
djidane35 CreditAttribution: djidane35 commentedOk I have found the problem.
All my website is developped on "Stage" workspace and it appears that Drush uses "live" workspace.
So, when I use admin menu, the selected workspace is "Stage" so all works good.
However, when I use drush, "live" workspace is selected and I have no data in this workspace.
Do you know how to select default workspace from drush ?
Comment #11
djidane35 CreditAttribution: djidane35 commentedPatch works perfectly.