Selection of either Menu tab or Default menu tab will cause 404 on every page on site with exception of the homepage if a single element url is specified

The issue arises in function fast_404_validate_path_drupal

136 $sql = "SELECT path FROM {menu_router} WHERE ? LIKE CONCAT(path, '%')";
137 $res = db_query($sql, array($q))->fetchField();
138 if ($res) {
139   return TRUE;
140 }

Lines 136 + 137 queries for every row in the menu_router table whose path column is a partial match for the current path being requested.

For example if the current requested path was admin/structure/pages, the result set would be:

[

'admin',

'admin/structure',

'admin/structure/pages'

]

However the menu_router table when using menu tab or default menu tab contains a row whose path column is set to '' which is a partial match for any string, so the result set is in fact:

[

'',

'admin',

'admin/structure',

'admin/structure/pages'

]

CommentFileSizeAuthor
#2 2408455-fast-404.patch1.91 KBCarlHinton
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

CarlHinton’s picture

Issue summary: View changes
CarlHinton’s picture

FileSize
1.91 KB