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.
The menu_router mysql check in fast_404_validate_path_drupal() is causing us issues.
We sometimes have a row in our menu_router table that is empty - caused by another mischievous module. It shouldn't be there, but when it is, it causes every page on the site to be a 404. Due to the WHERE ? LIKE CONCAT(path, '%')
check.
Also, I think we should keep the query should be as similar to the one in fast_404_validate_path_mysql()
.
Comment | File | Size | Author |
---|---|---|---|
#1 | fast_404-2210349-fix_query_in_fast_404_validate_path_drupal.patch | 3.9 KB | Leon Kessler |
Comments
Comment #1
Leon Kessler CreditAttribution: Leon Kessler commentedComment #2
BladeduThis query is wrong. It shouldn't contain a trailing slash "/" in front of the wildcard.
Comment #3
adammaloneAs a nitpick, there are also a bunch of empty lines in your patch that could ideally be gotten rid of to make the patch cleaner. If there are whitespace removals etc to clean up the module, they'd be greatly appreciated although would be a better fit in another issue :)
Comment #4
gappleI think ultimately the mischievous module needs to be fixed.
It looks to me that the lockout that ends up occurring is due to the
if ($res)
condition, which will fail on an empty string. Doing a stricter check on the return value of DatabaseStatementInterface::fetchField should be sufficient, but will then result in the function always returning true while the empty router entry exists.Comment #5
adammalone^ this