Problem/Motivation

   public function __construct(
     FileUrlGeneratorInterface $file_url_generator,
     FileRepositoryInterface $file_repository,
     FileSystemInterface $file_system,
     ClientInterface $http_client,
     EntityTypeManagerInterface $entity_type_manager,
     AccountProxyInterface $current_user,
     LoggerInterface $logger
   ) {
     $this->fileUrlGenerator = $file_url_generator;
     $this->fileRepository = $file_repository;
     $this->fileSystem = $file_system;
     $this->httpClient = $http_client;
-    $this->fileStorage = $entity_type_manager->getStorage('file');
+    $this->entityTypeManager = $entity_type_manager;
     $this->currentUser = $current_user;
     $this->logger = $logger;
   }

Steps to reproduce

Proposed resolution

This premature bootstrap might cause cache poisoning in some cases. I'm clutching at straws. Regardless, no need to invoke entity type manager getStorage() in the constructor.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3316620.patch2.64 KBheddn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heddn created an issue. See original summary.

heddn’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
2.64 KB
heddn’s picture

Issue summary: View changes
erikaagp’s picture

Status: Needs review » Reviewed & tested by the community

Looks good for me.

Graber’s picture

Will do no harm in any case even if it's not what caused the issue.
RTBC +1 (you did review thoroughly as well @erikaagp? 😉)

  • heddn committed 8bcba3b on 2.0.x
    Issue #3316620 by heddn, Graber: Invoking file storage in...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.