Skip to content
Snippets Groups Projects
Commit f9686b7a authored by Larry Garfield's avatar Larry Garfield
Browse files

Add BC shiv to keep old-style Dirty URLs working. This should be a temporary...

Add BC shiv to keep old-style Dirty URLs working.  This should be a temporary fix only, and be removed later.
parent dab4c21f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -31,10 +31,17 @@ class PathSubscriber implements EventSubscriberInterface {
* The Event to process.
*/
public function onKernelRequestPathResolve(GetResponseEvent $event) {
$request = $event->getRequest();
$path = ltrim($request->getPathInfo(), '/');
// Temporary BC shiv to support automated tests that still rely on old-
// style dirty URLs.
if (isset($_GET['q'])) {
$path = $_GET['q'];
}
if (empty($path)) {
// @todo Temporary hack. Fix when configuration is injectable.
$path = variable_get('site_frontpage', 'user');
......
......@@ -38,6 +38,15 @@ public function match($pathinfo) {
// Symfony uses a prefixing / but we don't yet.
$dpathinfo = ltrim($pathinfo, '/');
// Temporary BC shiv to support automated tests that still rely on old-
// style dirty URLs.
// @todo Remove this once testbot knows how to deal with Symfony-style
// dirty URLs.
if (isset($_GET['q'])) {
$dpathinfo = $_GET['q'];
$pathinfo = '/' . $dpathinfo;
}
// Do our fancy frontpage logic.
if (empty($dpathinfo)) {
$dpathinfo = variable_get('site_frontpage', 'user');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment