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.
If drupal is installed in a subdirectory accessing directly admin/modules/uninstall/confirm causes redirection to localhost/admin/modules/uninstall instead of localhost/drupal8/admin/modules/uninstall
This because \Drupal\system\Form\ModulesUninstallConfirmForm
line 113 uses relative path instead of route name for generate the redirect url:
return new RedirectResponse('/admin/modules/uninstall');
URLs should be generated from route names. It should be:
return $this->redirect('system.modules_uninstall');
Comment | File | Size | Author |
---|---|---|---|
#5 | uninstall_redirect-2112895-5.patch | 1.39 KB | willzyx |
#4 | uninstall_redirect-2112895-4.patch | 675 bytes | willzyx |
#3 | 2112895-3--uninstall_redirect.patch | 687 bytes | drunken monkey |
#1 | 2112895-1.patch | 735 bytes | swentel |
Comments
Comment #1
swentel CreditAttribution: swentel commentedAre you sure, because that is in the confirm buildForm method, not in the submit. None the less, that path is wrong indeed.
Comment #2
joachim CreditAttribution: joachim commentedI think URLs should now be generated from route names.
A quick grep for use of this class shows code like this:
Comment #3
drunken monkeyRan into the same problem just now, the attached patch seems to be the right way to fix it.
@swentel: I don't understand it either, the code doesn't look like it, but this is definitely where the problem is coming from. And without the patch, uninstalling also didn't work (at least for me, though that might have been a fluke).
Comment #4
willzyx CreditAttribution: willzyx commentedI think it should be
as is done in
ModulesListConfirmForm::buildForm()
Comment #5
willzyx CreditAttribution: willzyx commentedAdded test and update IS
Comment #6
willzyx CreditAttribution: willzyx commentedUpdate IS
Comment #7
joachim CreditAttribution: joachim commentedThat doesn't seem related to me.
Comment #8
willzyx CreditAttribution: willzyx commentedwhy do you think is not related? we should test that, by accessing directly to the confirm page, you will be redirected properly
Comment #9
joachim CreditAttribution: joachim commentedAh ok fair enough. That's a property of confirm forms I wasn't aware of.
Comment #10
aburrows CreditAttribution: aburrows as a volunteer commentedThis can be RTBC now #5 works, just tested by creating sub directory and moving site into that directory. Downloaded token 8.x and installed then uninstalled and returns user to modules page
Comment #12
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 487de77 and pushed to 8.0.x. Thanks!