Admin area where users are able to make menu edit changes to menu links e.g. /admin/structure/menu/manage/main seem to break core functionality when appending the forward slash to node references. The following steps will recreate the issue.

Steps to recreate:
1. Visit admin/config/search/path
2. Click on the ‘edit’ operation, assuming there are existing menu links created.
3. Append the 'System path' field value with the forward slash character ’/‘. e.g. /node/1 will become /node/1/
4. Save the changes.
5. Visit any page that contains the main menu and you’ll notice the url alias no longer working. The link will now reference the node path with the ‘/‘ prepended.

Note: Please be sure to disable all all caches, and will need to re-save #3(no edits) in order for the '/' to be stripped, as the '/' is stored in the database.

Issue fork drupal-3150472

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

cm0dit created an issue. See original summary.

cm0dit’s picture

StatusFileSize
new1.6 KB
new1.6 KB
durgeshs’s picture

Assigned: Unassigned » durgeshs
durgeshs’s picture

Assigned: durgeshs » Unassigned
StatusFileSize
new6.95 KB
new6.95 KB
new4.88 KB

Please review it.

durgeshs’s picture

Status: Active » Needs review
pankaj.singh’s picture

Assigned: Unassigned » pankaj.singh
pankaj.singh’s picture

Tested the patch, It works successfully on my end. The forwards slash "/" that was appended earlier is getting trimmed post applying the patch and URL alias "/about" is working.

Please refer to the SS attached for ref. RTBC+1

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

Drupal 9.0.10 was released on December 3, 2020 and is the final full bugfix release for the Drupal 9.0.x series. Drupal 9.0.x will not receive any further development aside from security fixes. Sites should update to Drupal 9.1.0 to continue receiving regular bugfixes.

Drupal-9-only bug reports should be targeted for the 9.1.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.2.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ranjith_kumar_k_u’s picture

StatusFileSize
new5.83 KB

The last patch failed to apply on 9.1 dev ,re-rolled for 9.1

spokje’s picture

Status: Needs review » Needs work

Patch #9 failed Custom Commands

anmolgoyal74’s picture

Status: Needs work » Needs review
StatusFileSize
new5.85 KB
new536 bytes

Nishat Ahmad made their first commit to this issue’s fork.

sulfikar_s’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new15.09 KB
new39.7 KB
new14.49 KB
new49.26 KB

Hello,

I've applied the #11 patch on 9.1.x-dev and it applied cleanly. The CSS issue is fixed in this patch.
Now the appended slash '/', is stripped after re-saving it.

I'm attaching the screenshots below,

Before patch,

  1. before-patch-1.png
  2. before-patch-2.png

After patch,

  1. after-patch-1.png
  2. after-patch-2.png

So changing the status to RTBC.

catch’s picture

Title: Menu and Path Module Issues » Trim trailing forward slashes from menu links
Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
@@ -90,7 +90,7 @@ public function testMenuLanguage() {

@@ -90,7 +90,7 @@ public function testMenuLanguage() {
     $menu_link = reset($menu_links);
     $this->assertMenuLink([
       'menu_name' => $menu_name,
-      'route_name' => '<front>',
+      'route_name' => '<none>',
       'langcode' => 'bb',
     ], $menu_link->getPluginId());
 

This seems unrelated to the change - why is it necessary to make the test pass?

I'm wondering if we should have an a post update to strip trailing slashes from the paths in path aliases and menu links.

nishat ahmad’s picture

StatusFileSize
new5.85 KB

I have generated this issues and the applying patch, It works successfully on my end.

The forward slash "/" that was appended earlier is getting trimmed post applying the patch and URL alias "/home" is working.

dhirendra.mishra’s picture

Status: Needs work » Needs review

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

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.