\Drupal::entityTypeManager()->getStorage call should be avoided use dependency injection instead

Created on 12 May 2023, over 1 year ago

Problem/Motivation

Currently the EntityTypeManager used in class SmartContentCDNConfigForm() does not use dependency injection. It should do this.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India Shanu Chouhan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Shanu Chouhan
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Shanu Chouhan

    Here's a patch for it.

  • Assigned to Kaustab_Roy
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India Kaustab_Roy

    Reviewed the patch #2

    It applies cleanly & resolves the phpcs --standard=DrupalPractice issues.
    But the module is throwing error:
    ArgumentCountError: Too few arguments to function Drupal\smart_content_cdn\EventSubscriber\HeaderEventSubscriber::__construct(), 0 passed in /app/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 1 expected in Drupal\smart_content_cdn\EventSubscriber\HeaderEventSubscriber->__construct()

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Kaustab_Roy

    Added Fixes for comment #3 along with the pending dependency injections.

  • First commit to issue fork.
Production build 0.71.5 2024