If you create two routes of which the paths are identical, except that the last fragment of one route is a fixed string, and of the other route it is a slug, one of them always takes precedence.

/foo/bar
/foo/{baz}

The route with the slug always takes precedence. The attached patch, made by dawehner, demonstrates the failure.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xano’s picture

Status: Active » Needs review
FileSize
1 KB
1.79 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +WSCCI

I think this is the proper fix.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, drupal_sad_slug.patch, failed testing.

Xano’s picture

drupal_sad_slug.patch contains the test that exposes the bug and fails as expected. drupal_2036241_1.patch contains both the fix and the test and passes as expected.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

So back to RTBC

catch’s picture

Status: Reviewed & tested by the community » Fixed

This would affect node/%node vs. node/add if those had been converted already.

Committed/pushed to 8.x.

Also opened #2040571: Missing index on router table.

Xano’s picture

I was browsing the commit log and noticed that the last one is from 9 hours ago. Did your push fail?

catch’s picture

Yes :(

Pushed again.

Automatically closed -- issue fixed for 2 weeks with no activity.