Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The isHomePath parameter is showing always false, even if the provided path is home path.
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff_5-8.txt | 634 bytes | baikho |
#8 | decoupled_router-3036392-8.patch | 3.18 KB | baikho |
| |||
#5 | interdiff_3-5.txt | 1.81 KB | baikho |
#3 | Screenshot 2019-03-09 at 13.12.55.png | 64.83 KB | baikho |
#3 | interdiff_2-3.txt | 586 bytes | baikho |
Comments
Comment #2
rhristov CreditAttribution: rhristov at Bulcode commentedIt is because in resolvedPathIsHomePath $resolved_path is absolute url and $home_path is relative. Applying a patch that is converting the home path to absolute url.
Comment #3
baikhoAfter applying the patch,
isHomePath
still returnsFALSE
, because the newly assigned variable$home_url
doesn't resolve to a URL. Subsequently then the end comparison still fails.See re-rolled patch which fixes
$home_url
to a URL string with manual test through Postman for which ie.node/3
is set to be the front page.Comment #4
e0ipsoCan we add a test that fails before the code fix, and then passes after the code fix?
Comment #5
baikho@e0ipso thanks for your review.
I've added a
testHomPathCheck
to theDecoupledRouterFunctionalTest
class. (See re-rolled patch)Comment #6
baikhoComment #7
e0ipsoThanks so much for this test. Only a minor question:
Why do we need to login as an admin user for this test?
Comment #8
baikhoGood point, no need for it. See re-rolled.
Comment #9
rhristov CreditAttribution: rhristov at Bulcode commentedSeems like when the site is multilanguage and for its detection is used domain based URL negotiator, as in my case, the URL is absolute without explicitly defining it, as it is done in #3.
Good catch Baik Ho.
Comment #11
e0ipsoMerged!