Problem/Motivation
Hello,
Tried to install 8.x-1.0-rc3 on a fresh and minimal install of Drupal 9.1.4 and I got this error:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined function Drupal\tb_megamenu\Plugin\Derivative\menu_ui_get_menus() in Drupal\tb_megamenu\Plugin\Derivative\TBMegaMenuBlock->getDerivativeDefinitions() (line 45 of modules\tb_megamenu\src\Plugin\Derivative\TBMegaMenuBlock.php).
Hope you can resolve it, thanks you very much for this module.
Steps to reproduce
Just install it without any other module and you crash your site instantly.
Comments
Comment #2
slayer722 commentedComment #3
arshadkhan35 commentedHi @slayer722 we can use
$menus = \Drupal\system\Entity\Menu::loadMultiple(); asort($menu_list);instead of$menus = menu_ui_get_menus();, please see this https://www.drupal.org/node/3027453, patch to fix the same.Comment #4
slayer722 commentedHi @arshadkhan35,
Thank you very much for your very quick help and the patch!
I tried it for a little while and everything works well now.
It can be committed I think.
Comment #5
quondam commentedComment #6
quondam commentedI've also tested the patch provided by @arshadkhan35 and found it caused no issues under 9.1.4, so I went ahead and merged those changes via this commit.
The fixes will be rolled into our next release (candidate) but if you'd like to apply them sooner you can download the latest 8.x-1.x-dev branch directly from the drupalcode.org repository and overwrite the
/modules/contrib/tb_megamenudirectory in your filesystem with the contents of that download.