It appears this is not related to the issue as was assumed in (#1 - #11):PathMatcher::isFrontPage() does not work for the default homepage if it contains a query string.
I have tested this with a small block that displayed the value of PathMatcher::isFrontPage()
, but it also appears to affect the menu system (where I first noticed this):
Issue since #12:
When appending a query string to a URL, the active trail is no longer added. This is undesirable because queries might be added for tracking a user's entrypoint eg example.com?referrer=email
or pagination on a page (the second page of the menu item is still in the active trail of the menu item).
These situations will make that you see the home page, but it is not marked as active.
Reproduce:
- Visit the regular front page of your Drupal site:
example.com
. - Append a query string to the url:
example.com?foo=bar
. - Notice that the home menu item no longer has the
is-active
class. - Then repeat the same test with JavaScript disabled in development console and not being logged in. Notice the same behavior.
I could only achieve above behavior with the home page (example.com?foo=bar
and example.com/node?foo=bar
) and all other paths work as expected, so there appears to be something wrong with this default front page path somehow.
This appears not to be only limited to the home page anymore. Appending a query string to other pages also makes they are no longer marked active.
Before:
After patch #42: