Problem/Motivation
The application health check results give a 500 error.
Steps to reproduce
Drupal core 10.1.1
Monitoring 8.x-1.13
Location:
/json/oh-dear-health-check-results
Message:
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 /usr/www/users/loginout/production/outfoxlogin/web/modules/contrib/ohdear_integration/src/Controller/OhDearIntegrationController.php on line 84 in Drupal\ohdear_integration\Controller\OhDearIntegrationController->__construct() (line 72 of /usr/www/users/loginout/production/outfoxlogin/web/modules/contrib/ohdear_integration/src/Controller/OhDearIntegrationController.php).
Proposed resolution
Replace Drupal\Core\Http\RequestStack and use the Symfony class Symfony\Component\HttpFoundation\RequestStack directly.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | diffs[1].diff | 1.19 KB | bbrala |
Issue fork ohdear_integration-3375906
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
keshavv commentedI have checked the MR and confirmed that It is working perfectly, Because
use Drupal\Core\Http\RequestStack;is deprecatedso it will encounter the error.
https://www.drupal.org/node/3265357
We can go with the MR.
Thank you.
Comment #4
useernamee commentedThank you for your contribution.
I've reproduced the issue on d10. Code change fixes the issue.
I've tested it on d9.5 - code change doesn't broke the controller output.
I'm a bit vary about the d8 compatibility but currently I don't have capacity to test. I'm not sure, maybe we should just stop supporting d8.
Comment #6
useernamee commentedd9 and d10 tests are passing.
merged & done
Will be part of next release (not sure when this will happen).
Comment #8
bbralaUploading patch