On ex2, we have set menu_default_active_menus', array_keys(menu_list_system_menus())) to an array, because no menu module created menus get displayed on the site, and having an empty array saves some unnecessary processing.

However menu_link_preferred() puts the results of that variable into an IN() condition, causing illegal SQL if it's empty.

The patch is easy but I need to check if the resultant query can use indexes.

CommentFileSizeAuthor
#4 menu_names.patch1.18 KBcatch
menu_names.patch666 bytescatch

Comments

catch’s picture

hmm, the use case for setting this to an empty array appears to have disappeared, because this is no longer called via the same code path, however an empty array is still a valid value.

catch’s picture

Priority: Normal » Minor
damien tournoud’s picture

Priority: Minor » Normal
Status: Needs review » Needs work

An empty $menu_names doesn't mean "all menus should be considered" by "no menus should be considered". That means that we have to simply return NULL here.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new1.18 KB

Works for me.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.