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.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | menu_names.patch | 1.18 KB | catch |
menu_names.patch | 666 bytes | catch | |
Comments
Comment #1
catchhmm, 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.
Comment #2
catchComment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedAn 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.Comment #4
catchWorks for me.