When I try to create a link: www.mysite.com/404 in a hook_menu() implementation, I get the not found page (which is another 404 page, not my custom). This also happens with any paths I try, which only contain digits.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 2456193-16.patch | 2.7 KB | poker10 |
| #16 | 2456193-16_test-only.patch | 1.11 KB | poker10 |
| #15 | patch_apply.png | 44.64 KB | vikashsoni |
| #13 | numeric-menu-item-paths-2456193-13.patch | 1.55 KB | psha |
| #7 | numeric-menu-item-paths-2456193-7.patch | 1.54 KB | psha |
Comments
Comment #1
psha commentedThis patch fixes the issue by changing the menu.inc core file.
Comment #3
kalinchernev commentedProblem reproduced, patch working correctly.
Comment #4
kalinchernev commentedComment #5
dcam commentedNo. A patch with 388 test failures and 37 exceptions is not working correctly.
@psha
Thank you for your contribution! In the future, please set the issue version to the *-dev version to ensure the patch is tested against the latest code.
Comment #6
dawehnerAs a workaround you can probably use a path alias for this particular usecase.
Comment #7
psha commentedThanks for the response. I also noticed multiple practical bugs. I hope this one works.
Comment #8
psha commentedComment #9
kalinchernev commentedWorks well for me, and all tests pass, good job! :)
Comment #10
kalinchernev commentedchanging the status, because the tests are passing and the code changes seem safe enough for me
Comment #11
David_Rothstein commentedHm, I'm not sure we want to do this. It means that previously the new items took precedence, but now the existing ones do. In general people probably shouldn't be defining the same menu item in more than one module, but I bet it happens and we could introduce some weird bugs this way.
Can't we do it in a way that doesn't change the precedence?
Comment #12
David_Rothstein commentedAlso, has anyone checked whether this issue affects Drupal 8 too?
Comment #13
psha commentedThis change produces the same array values as array_merge, except for the order of the elements, but the array will get sorted anyways.
Comment #14
kalinchernev commented@David_Rothstein I don't think the issue is relevant to Drupal 8. The routing definitions are key:value pairs of strings
Comment #15
vikashsoni commentedThanks for the patch it's working fine for me
Comment #16
poker10 commentedThe patch from #13 still applies correctly to D7 HEAD and tests are passing. I think this needs a test so the issue can be considered by maintainers. I am adding a simple test that verifies if a numeric link is accessible. Patch itself is unchanged (except that I tweaked the comment a little bit).
And to address these concerns about the performance: #1177656-5: Support for top-level, numeric menu paths, I will try to test the patch on some sites with several thousands menu items to see if the performance differs.
Comment #18
poker10 commented