Comments

sandeepreddyg created an issue. See original summary.

lauriii’s picture

Issue tags: +Needs tests

Thanks for reporting the bug. Just tagging this with needs tests since it would be important to have some test coverage for this.

sandeepguntaka’s picture

Status: Active » Needs review
StatusFileSize
new411 bytes

This solved the issue for me.

garnett2125’s picture

Patch works for me, thanks.

nkoporec’s picture

Status: Needs review » Reviewed & tested by the community

Patch works and applies cleanly,marking as RTBC.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Thank you for the bug fix. Since this is a bug, we should add some test coverage before committing this.

c.e.a’s picture

Patch #3 working as expected... thank you

moshe weitzman’s picture

#3 worked for me as well. maybe this can go into he module soon, given that we waited 2 years for tests so far.

bombjack’s picture

#3 worked for me too. Hope it gets committed :)

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB
new1.3 KB

Status: Needs review » Needs work

The last submitted patch, 10: 2865039-10-test-only.patch, failed testing. View results

jeroent’s picture

It seems the code changes introduced some other test failures. The newly created test is failing when the page is not accessible.

dave reid’s picture

I believe the tests are in fact failing due to this change. It wasn't that long ago that I ensured everything was passing on both 8.9 and 9.0.

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new1.32 KB
new1.73 KB

Let's try that again.

jeroent’s picture

ha, it seems the testbot couldn't differentiate the "/kittens" and "/kitténs" url. I updated the URL in the test case and now it should work.

The last submitted patch, 14: 2865039-14-test-only.patch, failed testing. View results

jeroent’s picture

Issue tags: -Needs tests
jamiehollern’s picture

I have stumbled across this issue, although perhaps it isn't the same but similar. In situations where the path alias has a special character, Drupal\Core\PathProcessor\PathProcessorDecode::processInbound() alters the path before it hits the subpathauto inbound path processor, meaning that subpathauto returns early and doesn't process the path. For example, the path /§-test becomes /%C2%A7-test, which fails the comparison check. This then causes a 404. In this situation, I believe a check should be made against an encoded path just to be sure.

I have attached a patch to this comment with an appropriate solution; it contains no tests currently.

jeroent’s picture

Status: Needs review » Reviewed & tested by the community

If the issue isn't the same, I would suggest creating a separate issue. The patch provided in #3 fixed the problem for a lot of users and test coverage was added in #14 so I guess the patch in #14 is ready to go.

jeroent’s picture

joshuami’s picture

I'm not getting these patches to cleanly apply. I ran across an issue that has a slightly different approach that applies cleanly—but lacks a test. If a maintainer sees this issue, it might be worth taking the approach that URL encodes all the path parts rather than running things through a regex.

From #3130139:

+  /**
+   * Encodes all parts of a path
+   * @param  string $path 
+   *   The path of the request.
+   * 
+   * @return string      
+   *   The encoded path of the request.
+   */
+  public function encodeParts($path) {
+    $path_parts = [];
+    foreach (explode('/', $path) as $key => $value) {
+      $path_parts[] = urlencode($value);
+    }
+    return implode('/', $path_parts);
+  }
+
eric.napier’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.95 KB

Using the original patch in #3, I've written a new test that will apply cleanly. The previous contributed test in #14 adds new node creation to the setup() method of SubPathautoFunctionalTest, which causes the new node to be created for each test in SubPathautoFunctionalTest. In this new patch I've taken a different approach that only creates the new test node once, and better isolates the test case.

eric.napier’s picture

This is a re-roll of the patch in #22, removing additional unintended spaces from PathProcessor.php.

eric.napier’s picture

One more re-roll of this patch from #22. Reviewing the patch again I notice that the block module is not needed for this test, so this new patch removes 'block' from the array of modules in the test.

vidorado’s picture

#24 works for me :)

kim.pepper’s picture

Issue tags: +#pnx-sprint
heddn’s picture

Status: Needs review » Reviewed & tested by the community

/my-group/content/create/group_node:page => works
/my-group/content/create/group_node%3Apage => doesn't work

But with the patch, it works. RTBC, since there's also tests.

  • lauriii committed 8b3b838 on 8.x-1.x
    Issue #2865039 by JeroenT, eric.napier, sandeepguntaka, jamiehollern,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for adding the test coverage! Committed!

Status: Fixed » Closed (fixed)

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