Hello,

on the Edit menu "Main navigation" page, I have menu items listed.
I can create or delete menu items.
but doing such action, I am being redirected to the Menus management page rather than the Edit menu page.
and that is not practical when I want to create many menu items, or remove many of them.

Thanks!

Comments

Wisamx created an issue. See original summary.

Wisamx’s picture

Title: after adding a menu item, I am directed to the main menus list » after adding a menu item, I am redirected to the Menus Management page rather that the Menu Edit page
cilefen’s picture

Issue tags: +Usability

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ivnish’s picture

Same problem

bmx269’s picture

This is a very irritating way that the menu works.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

larowlan’s picture

Assigned: Wisamx » larowlan

This is indeed annoying, working on a fix

larowlan’s picture

Assigned: larowlan » Unassigned
Status: Active » Needs review
StatusFileSize
new783 bytes
new1.55 KB

This adds the fix and a test

larowlan’s picture

Title: after adding a menu item, I am redirected to the Menus Management page rather that the Menu Edit page » After adding, deleting or editing a menu item, I am redirected to the Menus Management page rather than returned to the Menu Edit page
larowlan’s picture

Ah, so linkByHrefExists is actual 'link containing href exists' so adding another assert that the destination isn't there.

ivnish’s picture

#12 works!

ivnish’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Status: Reviewed & tested by the community » Needs work

We still need a failing test here

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

nikitagupta’s picture

Status: Needs work » Needs review
StatusFileSize
new1.68 KB
ketikagrover’s picture

Assigned: Unassigned » ketikagrover
shimpy’s picture

Assigned: ketikagrover » shimpy
shimpy’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new61.24 KB
new62.54 KB

I have tested patch #17 . Applied successfully and working as per functionality. Attaching screenshots for reference

Before applying patch
Before patch menu link redirection

After applying patch

after patch

sivaji_ganesh_jojodae’s picture

+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -231,6 +231,9 @@ public function addCustomMenu() {
+    $url = Menu::load($menu_name)->toUrl('edit-form');
+    $this->assertSession()->linkByHrefExists($url->toString());
+    $this->assertSession()->linkByHrefNotExists($url->setOption('query', ['destination' => '/admin/structure/menu'])->toString());

Not sure if $this->assertSession() needs instantiation twice.

Maybe changed

+    $this->assertSession()->linkByHrefExists($url->toString());
+    $this->assertSession()->linkByHrefNotExists($url->setOption('query', ['destination' => '/admin/structure/menu'])->toString());

to

$assertSession = $this->assertSession();
$assertSession->linkByHrefExists($url->toString());
$assertSession->linkByHrefNotExists($url->setOption('query', ['destination' => '/admin/structure/menu'])->toString());
alexpott’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#2957953: Editing menus user-experience has regressed

This is a duplicate of #2957953: Editing menus user-experience has regressed - which is an early issue, has more explicit testing. I think we should merge the approaches. This was caused by #2767857: Add destination to edit, delete, enable, disable links in entity list builders which I've kind of always felt should have been rolled back.

I quite like the fix here as it removes the default redirection completely but it'd be great continue to work in #2957953: Editing menus user-experience has regressed and add more test coverage of deleting and editing a menu-link via the UI so we can be sure that everything behaves as we'd like.