HealthCheck gives error in controller

Created on 15 August 2023, over 1 year ago

Problem/Motivation

TypeError: Drupal\ohdear_integration\Controller\OhDearIntegrationController::__construct(): Argument #4 ($request_stack) must be of type Drupal\Core\Http\RequestStack, Symfony\Component\HttpFoundation\RequestStack given, called in /srv/app/modules/contrib/ohdear_integration/src/Controller/OhDearIntegrationController.php on line 89 in Drupal\ohdear_integration\Controller\OhDearIntegrationController->__construct() (regel 72 van /srv/app/modules/contrib/ohdear_integration/src/Controller/OhDearIntegrationController.php).

Might be something because of the enviroment:
PHP 8.1, Drupal 10.1

Steps to reproduce

Run on PHP 8.1 and Drupal 10.1, you should see an error.

Proposed resolution

Perhaps typehint Symfony\Component\HttpFoundation\RequestStack. Although it seems there might be a relevant deprecation which also suggests that . From the change recorD:

-----

The Symfony 4 RequestStack BC shim Drupal\Core\Http\RequestStack is deprecated.

It was added to support RequestStack to have either getMainRequest() or getMasterRequest() methods.

Now Drupal 10 has moved to Symfony 6, this shim is no longer needed there and is deprecated for removal in Drupal 11.
There is no replacement, you can use the Symfony class Symfony\Component\HttpFoundation\RequestStack directly.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇳🇱Netherlands bbrala Netherlands

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

Comments & Activities

Production build 0.71.5 2024