Needs work
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Mar 2020 at 04:22 UTC
Updated:
12 Nov 2025 at 15:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
s_bhandari commentedComment #4
s_bhandari commentedComment #5
hardik_patel_12 commentedKindly review a patch.
Comment #6
msutharsComment #7
msuthars@Hardik_Patel_12 MailManager is pending of Ioc service injection. You can inject the
request_stackservice in it.example:
$this->request = $request_stack->getCurrentRequest();Comment #8
hardik_patel_12 commentedInjected \Drupal::request() call in MailManager class , kindly review a new patch.
Tasks left:
Comment #9
jungleThanks @Hardik_Patel_12 for the patch, per the parent issue, rescoping this to do it for non-test code.
So I have to set back to NW for removing changes in tests, sorry, commenting to other sibling issues I filed.
Comment #10
ravi.shankar commentedHere I have made changes as suggested in comment #9, please review.
Comment #12
jungleLooks like there are a few more to do.
Comment #13
nikitagupta commentedComment #14
junglePatch failed to apply.
Comment #15
nikitagupta commentedComment #16
hardik_patel_12 commented@nikitagupta thanks for working on this issues , but we need to inject Request(\Drupal::request()) service before replacements as we have done in core/lib/Drupal/Core/Mail/MailManager.php file.
Solving failed test cases of #10 , if we want do changes for only non-test file then this test cases will always gone be fail.
FOr this file \Drupal::request() call is under static function so this looks ok to me.
For this files can anyone suggest good way to inject \Drupal::request() call.
Comment #22
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
At this time we will need a D10 version of the patch.
Also D10 should be checked to see if there are additional instances of \Drupal::request() that need to be addressed.
Thanks
Comment #23
nitin shrivastava commentedreroll for drupal 10
Comment #24
smustgrave commentedStill seem to be instances
ViewExecutable
DbUpdateController
Not sure if entities or traits count.
Comment #26
hardik_patel_12 commentedUpdating deprecation message for drupal:11.0.0.
The invocation of \Drupal::request() is located within a static function in DbUpdateController, making it uncertain whether it should be modified.
Comment #31
samitk commentedComment #32
smustgrave commentedShould use constructor promotion now.
Comment #33
samitk commentedHi @smustgrave,
Please review.
Thanks
Samit K.
Comment #34
smustgrave commentedLeft a comment but not sure we can fully remove parameters and add new ones without doing a BC step.
Also what was the search that was ran to find these, imagine there are more.
Comment #35
dcam commentedcore/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.phpalso has a call to\Drupal::request()as noted in #3373074: Call to a member function has() on null in Drupal\Core\Mail\Plugin\Mail\PhpMail->mail().Comment #36
dcam commented