Skip to content

Drush sets request with "/" path, but it is not a frontpage. #6352

@drudoi

Description

@drudoi

Describe the bug
Drush prepares request in the next way:

// Drupal 10
$request = Request::createFromGlobals();

Which leads to:

$request->getPathInfo() === '/';

The same time:

$pathMatcher->isFrontPage() === FALSE;

It could lead to bad cache data in caches using contexts ["url.page", "url.page.is_front"];

See https://www.drupal.org/project/drupal/issues/3545715

To Reproduce

See https://www.drupal.org/project/drupal/issues/3545715

Expected behavior

It open question should drush scripts be executed as a frontpage request or not.

If yes, "$pathMatcher->isFrontPage()" should return TRUE.
If no, there shouldn't be any request in request stack or request should lead to some "/drush" fake path.

System Configuration

Q A
Drush version? 13.x
Drupal version? 11.x/10.x
PHP version 8.x
OS? Docker/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions