Closed (duplicate)
Project:
Drupal core
Version:
9.1.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Jul 2020 at 09:47 UTC
Updated:
21 Jul 2020 at 11:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hardik_patel_12 commentedKindly review a patch.
Comment #4
hardik_patel_12 commentedRandom failed test case, retesting the patch.
Comment #5
longwaveNot sure we should be injecting the state service into ProviderRepository if we only need it for the purposes of a test.
If we really want to remove \Drupal::state() here we can inject the service in MediaTestOembedServiceProvider instead, either by extending the constructor or using setter injection.
Comment #6
hardik_patel_12 commented@longwave , thankyou for review . Removing state injected service from ProviderRepository class from last patch.
There more instances that can be injected:
Injecting state service in HtmlResponseAttachmentsProcessor file , but for Theme.php i am not sure because it is not using create menthod neither it is service.
Kindly review a new patch.
Comment #8
jungleThanks everyone for working on this, this is a duplicate of #3123228: Replace non-test usages of \Drupal::state() with IoC injection, which was filed earlier than this.