Remove the $user_storage = \Drupal::entityTypeManager()->getStorage('user');

Use the dependency injection: $user_storage = $this->entityTypeManager->getStorage('user');

CommentFileSizeAuthor
#2 3360148-2.patch831 bytesshanu chouhan
Command icon 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

Shanu Chouhan created an issue. See original summary.

shanu chouhan’s picture

Assigned: shanu chouhan » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new831 bytes

Fixed use dependency injection instead of $langcode = \Drupal::currentUser();

shashank5563 made their first commit to this issue’s fork.

shashank5563’s picture

Issue summary: View changes

I have create MR4 for this issue.

shashank5563’s picture

Title: \Drupal::currentUser() call should be avoided in classes, use dependency injection instead in Controller » Avoided to use drupal service instead of dependency injection
Issue summary: View changes
shashank5563’s picture

Issue summary: View changes

rajan kumar’s picture

Status: Needs review » Fixed
rajan kumar’s picture

Status: Fixed » Closed (fixed)