Front page path with query parameters makes front path condition to fail

Created on 20 April 2024, 2 months ago

Problem/Motivation

Working on πŸ› url() should return / when asked for the URL of the frontpage Needs work , I found that by setting a path with parameters as front page makes PathMatcher::isFrontPage() to fail. It seems that path condition checker relies on it.

Steps to reproduce

In a fresh Drupal 10.2 installation (standard profile):

  1. go to Configuration -> Basic site settings
  2. change the default front page to "/node?a=1"
  3. go to Structure -> Block layout and click on configure the "Powered by Drupal" block in the Footer Bottom region
  4. in the Visibility settings, restrict it to be hide in the front page by adding "" to Pages text area and selecting "Hide for the listed pages". Save the block
  5. go back to the site front page. The "Powered by Drupal" is displayed and it shouldn't

Proposed resolution

I think is that the main question here is, should query parameters not being permitted in front, 403 and 404 page paths? In such case it should be documented and some sort of validation being added. Otherwise, query parameters should be fully supported for them.

I found that the front page inbound path processor is aware of query parameters usage in the front page site settings.

Remaining tasks

TBD.

User interface changes

TBD.

API changes

N/A

Data model changes

N/A

Release notes snippet

TBD.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 21 minutes ago

Created by

πŸ‡ͺπŸ‡ΈSpain manuel.adan 🌌

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024