Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | 3316620.patch | 2.64 KB | heddn |
Comments
Comment #2
heddnComment #3
heddnComment #4
erikaagp CreditAttribution: erikaagp at CI&T commentedLooks good for me.
Comment #5
Graber CreditAttribution: Graber at Tag1 Consulting for American Federation of Teachers commentedWill do no harm in any case even if it's not what caused the issue.
RTBC +1 (you did review thoroughly as well @erikaagp? 😉)
Comment #7
heddn