Closed (duplicate)
Project:
Drupal core
Version:
9.0.x-dev
Component:
workflows.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Jan 2020 at 11:08 UTC
Updated:
23 Mar 2020 at 17:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hardik_patel_12 commentedKindly review a patch.
Comment #3
hardik_patel_12 commentedComment #4
rogerpfaffLooks good. Patch applies and code does what it is intended for.
Comment #5
alexpott@Hardik_Patel_12 thank you for your contribution.
At a minimum this needs to address WorkflowTransitionAddForm too but the rest of the Workflows module should be checked as well. Also the scope of these "\Drupal calls should be avoided in classes, use dependency injection instead..." issues should be agreed in #2729597: [meta] Replace \Drupal with injected services where appropriate in core as there appears to be a lot of prior art.
Comment #6
hardik_patel_12 commentedCombining #3107619: \Drupal::entityTypeManager()->getStorage call should be avoided use dependency injection instead
Comment #7
hardik_patel_12 commentedKindly review a new patch.
Comment #8
hardik_patel_12 commentedComment #9
alexpottAlso you need to do the deprecation dance in the constructor and add a change record. When we add arguments to a constructor like this we make them optional and do a deprecation if called without. See for example the code in \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::__construct() on Drupal 8.9.x
Also new deprecations (for Drupal 10) at the moment will done once 9.1.x opens as the higher priority work is to remove deprecations from Drupal 9.
Comment #10
kishor_kolekar commentedplease review the new patch.
Comment #12
hash6 commentedComment #13
hash6 commentedComment #14
hash6 commentedSince
EntityFormclass already has$entityTypeManagervariable defined , the class extending it need not redefine it usingContainerInterfaceimplementation.Comment #15
sam152 commentedThere is some extra whitespace added here.
Comment #16
kishor_kolekar commentedplease review the new patch .
Comment #17
xjmThank you for filing this and for your contributions so far.
I am closing this as a duplicate of #2729597: [meta] Replace \Drupal with injected services where appropriate in core. You can use the work in the patches from this and similar issues as starting points for new issues scoped by concept.