Problem/Motivation

The InvalidArgumentException from "$this->aliasManager->getAliasByPath($path)" is left unhandled. So visiting invalid urls causes this subsystem to generate fatal errors.

Steps to reproduce

Have any block setup with any visibility rule applying to the "Request Path" condition.
Visit https://yoursite.com/index.phpsometext

Proposed resolution

Catch the Exception

Remaining tasks

Review and apply patch.

User interface changes

None

API changes

None

Data model changes

None.

Release notes snippet

Comments

weseze created an issue. See original summary.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mstrelan’s picture

Component: system.module » routing system

Confirming I can reproduce the error with the steps to reproduce. What I don't understand is why anyone would go to a path like /index.phpsometext and why Drupal handles it differently to /sometext. I don't think the RequestPath condition is the right place to handle this, seems like more of a routing issue.

weseze’s picture

What I don't understand is why anyone would go to a path like /index.phpsometext

To fill up the logs of a website with errors.
Or if you want to stay on top of errors and have those on a daily mail or sent through slack or some other platform, this becomes very annoying... Can't think of any legit reason to do so though.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.