Comments

Hardik_Patel_12 created an issue. See original summary.

hardik_patel_12’s picture

StatusFileSize
new2.24 KB

Kindly review a patch.

hardik_patel_12’s picture

Assigned: hardik_patel_12 » Unassigned
Status: Needs work » Needs review
rogerpfaff’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Patch applies and code does what it is intended for.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

@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.

hardik_patel_12’s picture

StatusFileSize
new4.51 KB

Kindly review a new patch.

hardik_patel_12’s picture

Status: Needs work » Needs review
alexpott’s picture

Title: \Drupal calls should be avoided in classes, use dependency injection instead in WorkflowStateAddForm.php » \Drupal calls should be avoided in classes, use dependency injection instead in the Workflows module
Status: Needs review » Needs work
Issue tags: +Needs change record

Also 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.

kishor_kolekar’s picture

Status: Needs work » Needs review
StatusFileSize
new3.44 KB
new3.84 KB

please review the new patch.

Status: Needs review » Needs work

The last submitted patch, 10: 3108251-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

hash6’s picture

Assigned: Unassigned » hash6
hash6’s picture

Assigned: hash6 » Unassigned
StatusFileSize
new1.79 KB
new2.65 KB
hash6’s picture

Status: Needs work » Needs review

Since EntityForm class already has $entityTypeManager variable defined , the class extending it need not redefine it using ContainerInterface implementation.

sam152’s picture

Status: Needs review » Needs work
+++ b/core/modules/workflows/src/Form/WorkflowStateAddForm.php
@@ -24,6 +24,7 @@ class WorkflowStateAddForm extends EntityForm {
+

There is some extra whitespace added here.

kishor_kolekar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.03 KB
new1.1 KB

please review the new patch .

xjm’s picture

Status: Needs review » Closed (duplicate)

Thank 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.