Problem/Motivation

When saving a menu, the user will by default be redirected to the menu top level at admin/structure/menu/manage/. This would happen even when saving a "child menu" menu at admin/structure/menu/manage/?menu_link=menu_link_content.

This module alters the redirect destination so that the user would stay in the child menu instead of being redirected to the top level. This is very convenient.

However, if Drupal is installed in a subdirectory or behind a reverse proxy, in an address like example.com/drupal/, then this custom redirect does not work as intended, but instead redirects the user to /drupal/drupal/admin/structure/menu/manage/?menu_link=menu_link_content (note the double folder name at the beginning).

Steps to reproduce

  1. Install Drupal in a subdirectory, eg example.com/drupal/
  2. Go to admin/structure/menu/manage/main, add links in multiple levels
  3. Click "Edit child items" to edit a child menu
  4. Save the child menu
  5. You should now see the Drupal 404 page, and the URL should start with /drupal/drupal/...

Proposed resolution

  • Option A: Remove the call to $form_state->setRedirectUrl(), and disable the redirect completely using $form_state->disableRedirect()
  • Option B: Remove the call to $form_state->setRedirectUrl(), and add ?destination parameters to the "Edit child items" links
CommentFileSizeAuthor
#3 3247189-3-option-b.patch2.39 KBrade
#2 3247189-2.patch661 bytesrade

Issue fork bigmenu-3247189

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Rade created an issue. See original summary.

rade’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new661 bytes

Attaching patch for proposed solution, option A.

rade’s picture

StatusFileSize
new2.39 KB

And here is a patch for proposed solution, option B.

nigelheinsius’s picture

Three years on from this original post by Rade. I am still experiencing this issue. My fix is a one-liner in the .htaccess file:

RewriteRule ^SUBDIRECTORY/admin/structure/menu/manage/(.*)$ /SUBDIRECTORY/admin/structure/menu/manage/$1 [L,NC,R=302]

rakesh.regar made their first commit to this issue’s fork.