Our Blog

You can’t have paths like /404 or /007 in Drupal?!

Asparuh Krastev
by Asparuh Krastev on Tue 15 December 2015 No comments

In this post I like to inform you about an important defect, I found recently.

In a project, I was working on, I had to make a custom 404 error page. Easy enough. Naturally I came up with /404 path and decided to use hook_menu() for the job. Unfortunately after implementing the hook, I was not able to open the page. Needless to say I cleared the cache multiple times.

It turned out that the bug was in the core of Drupal and the reason was the use of array_merge() and array_multisort() PHP functions. Both functions re-index array keys, which are strictly numerical. In my case 404 became 0.

Here is a link to the issue. Inside there is a patch made by me, which fixes the bug. Use the latest one. Hopefully this patch will be released soon.

Asparuh KrastevYou can’t have paths like /404 or /007 in Drupal?!

Join the conversation