Closed (duplicate)
Project:
Drupal core
Version:
9.2.x-dev
Component:
menu system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jul 2014 at 22:00 UTC
Updated:
26 Oct 2020 at 03:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #7
ivnishYes! Redirect to /admin/structure/menu after create new menu item (not new menu) makes me nervous.
Comment #8
ivnishComment #9
batkorHi guys!
i think need redirect to parent menu llist
Comment #10
ivnishComment #11
bmx269 commentedOn creating a menu "item", the user should be redirected to the parent menu of that newly created menu item.
Comment #12
batkorThis problem is related to
If set correct route solved issues in breadcrumb.
Comment #14
ddhuri commentedHere is the patch which works perfectly for me while adding and deleting menu links.
Comment #15
matthieuscarset commentedPatch #14 works like a charm.
Tested on Drupal 8.7.x with translations enabled.
Marking this issue as RTBC
Comment #16
larowlanThanks for your work here folks, but we need a test here to enforce this functionality into the future
Comment #17
ddhuri commentedUpdated #14 patch with minor typos.
Comment #20
WebbehI am scratching my head a little bit on how to write a test that informs this change, as I expect that the existing test cases should already cover it and should have caught it:
https://git.drupalcode.org/project/drupal/-/blob/9.0.x/core/modules/menu...
I'm assuming that the `drupalPostForm` actions don't generate the same query strings (in this case, the (?destination=). Is there a recommended way of designing a test that would encompass this use case?
My first thought was to build a menu test to step-wise walk-through the UI of creating, editing, and deleting a menu item through link clicks to see if that picks up the query strings.
(also apologies if this is a rudimentary query - this is my first dive into testing)
Comment #21
WebbehAnd lucky me, it looks like I answered my own question through snooping through the issue queue. #3164686: WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring details a bug with querystrings not being parsed.
Do we need to defer this until #3164686: WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring is resolved? Or, do we need to create an additional issue to refactor menu tests after the completion of #3164686: WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring?
Comment #22
batkor#14
Worked for me!
Drupal 8.9.2
Comment #23
Webbeh#3164686: WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring has been fixed, so we can now proceed with the work in #16 to enforce this via a test.
Comment #24
WebbehRe-rolled #17 for 9.1.x and undo the malformed element.
I also took a stab at trying to add tests to better enforce this via the request in #19. There is a simple test of add/edit/remove a link from a menu with `core/modules/menu_ui/tests/src/Functional/MenuUiTest.php` that asserted whether the return URL after saving those changes returned to the correct routing. I added in additional coverage to additionally check to see if it's going back to where we expect - the menu edit page.
For review.
(apologies if I messed something up with the patch - this is my first core patch, so it's a little different than my usual day-to-day contrib)
e: Scratch that, it looks like my patch did not include the changes from #17 like I thought I did... d'oh. Cancelled test and let me see if I can unbork my local environment ingestion of #17.
Comment #25
WebbehManually incorporated #17 into the work of #24, this now should encompass the work of this issue so far and can be more gracefully interdiff'd and built upon moving forward (without malforming).
(e: this patch may need reformatting for commit, apologies)
Comment #27
WebbehAh, the single failure likely came from the random .orig files that got pruned during the patch creation process:
e: Oh, I see. I have a local script that prunes bad files like this prior to commits, welp. Let me revise that.
Comment #28
WebbehRe-rolled #27 with the removal of the unnecessary file deletions.
Comment #29
amietpatial commented@Webbeh after applying your patch, I observed that if Parent is edited and saved first then the flow is fine but if you edit child first and save then the same redirection issue persists.
Please refer to screenshot.
Comment #30
amietpatial commentedComment #31
WebbehThanks for the feedback, testing, and edge-case testing!
Looks like we may need to refine the fix outlined in #14/#17 and re-rolled in #28.
Additionally, your comment suggests that I'll need to make a stronger test-case that is more encompassing of more menu item permutations to ensure this functionality is working as-expected. I suppose this provides a use-case for spinning this out into its own test function, rather than sitting inside of an existing menu UI test.
Comment #33
maosmurf commentedHi, this issue does look like a duplicate of https://www.drupal.org/project/drupal/issues/2975407 and https://www.drupal.org/project/drupal/issues/2957953 to me. Both are not really solved yet, though.
Comment #34
batkorHi
I'm update patch and changed "point" for change destination.
Please check patch
Comment #35
batkor#amietpatial check new patch. Solves your problem.
Comment #36
batkorPatch from this issues
woked for my. Drupal 9.2.0-dev.
And closed all problems referenced this issues.
Comment #37
pameeela commentedHi all,
This is a duplicate of #2957953: Editing menus user-experience has regressed and that has had a bit more activity, so I'm going to close this one to avoid any further duplication of effort.
I will add credit for all contributors here to get credit when it is fixed.
@baktor, can you please upload your last patch to the other issue?
Comment #38
pameeela commented