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.

CommentFileSizeAuthor
#3 3198123-3.patch1.28 KBarshadkhan35

Comments

slayer722 created an issue. See original summary.

slayer722’s picture

Issue summary: View changes
arshadkhan35’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

Hi @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.

slayer722’s picture

Hi @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.

quondam’s picture

Status: Needs review » Reviewed & tested by the community
quondam’s picture

Status: Reviewed & tested by the community » Fixed

I'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_megamenu directory in your filesystem with the contents of that download.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.