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.
Problem/Motivation
Install drupal in a subfolder, edit the administration menu (admin/structure/menu/manage/admin) and use the 'Add link' local action to create a custom menu link. Click Save and you get an error:
The requested page "/drupal/admin/structure/menu/manage/admin" could not be found.
Proposed resolution
Use system path as destination.
Remaining tasks
review
User interface changes
none
API changes
none
Comment | File | Size | Author |
---|---|---|---|
#27 | interdiff.txt | 1.95 KB | kgoel |
#27 | 2313263-27.patch | 3.54 KB | kgoel |
#22 | interdiff.txt | 1.81 KB | kgoel |
#22 | 2313263-22.patch | 3.58 KB | kgoel |
#18 | interdiff.txt | 651 bytes | olli |
Comments
Comment #3
olli CreditAttribution: olli commentedAnother try.
Comment #5
olli CreditAttribution: olli commentedComment #6
dawehnerOh, I really wanted to have a look at that
Do we really still need this todo here? OT
Comment #8
olli CreditAttribution: olli commentedComment #9
dawehnerMh, why aren't all strings available as the title?
Comment #10
olli CreditAttribution: olli commentedThey should be.
Comment #11
dawehnerTrue!
Comment #12
alexpottHow are we going to help people not make this mistake in the future - would seem a really easy thing to get confused.
getPathFromRoute() is marked for deprecation.
Comment #13
olli CreditAttribution: olli commentedGood points..
#12.1 - Are you suggesting that there might be a bug RedirectResponseSubscriber::checkRedirectUrl() because it redirects to an invalid internal path?
#12.2 - I have no idea what to use there instead.. even that checkRedirectUrl() uses it.
We still have drupal_get_destination(), which is not deprecated and might work in both cases...
Comment #14
olli CreditAttribution: olli commented#12.1 That ::getSystemPath is also deprecated. Here's a patch with drupal_get_destination().
Filed #2373017: No delete link when editing a menu, only reset links for this.
Comment #17
dawehnerThis is certainly much better. Ideally drupal_get_destination() could use something like internally, but well, that is out of scope of this issue.
Comment #18
olli CreditAttribution: olli commentedHere's a reroll.
Comment #19
olli CreditAttribution: olli commentedHow do I get the system path/set destination if I need to use something else than current path?
Comment #21
idebr CreditAttribution: idebr commentedThis patch also fixes #2395189: Deletion of menu link results in error, so bumping to major.
The edit and delete links for menu items are currently hardcoded to return back to the overview page. Does this question apply to this issue?
Comment #22
kgoel CreditAttribution: kgoel commentedComment #23
kgoel CreditAttribution: kgoel commentedComment #25
pwolanin CreditAttribution: pwolanin commentedThanks for fixing the tests to use routes.
The continued use of drupal_get_destination() is a bit frustrating, but I think it's the best we have right now.
Possibly should move this logic at least to the RouteMatch?
Comment #26
idebr CreditAttribution: idebr commentedThe alternative would be to make ConfirmFormHelper::buildCancelLink to accept urls instead of uris.
Note: this already works for form redirects/destination urls
Comment #27
kgoel CreditAttribution: kgoel commentedComment #28
kgoel CreditAttribution: kgoel commentedComment #29
pwolanin CreditAttribution: pwolanin commentedThanks. We need to make a replacement for drupal_get_destination() and/or fix the way the destination query string works, but that's beyond the scope of this patch.
Comment #30
alexpottThis issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 7816819 and pushed to 8.0.x. Thanks!
Yep
drupal_get_destination()
does seem out-of-place. Also how are we going to ensure people don't make this mistake in contrib?