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
/**
* Static cache of entities, keyed first by entity ID, then by an extra key.
*
* The additional cache key is to maintain separate caches for different
* states of config overrides.
*
* @var array
* @see \Drupal\Core\Config\ConfigFactoryInterface::getCacheKeys().
*/
protected $entities = [];
I can't see any access of $this->entities anywhere.
I suspect this is a leftover from before the memory cache service was added.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3201957-cleaning-up-unused-entities-property.patch | 864 bytes | bogdan.rizescu |
Comments
Comment #2
bogdan.rizescu CreditAttribution: bogdan.rizescu at Google Summer of Code commentedI have created a patch for this issue. I deleted the unused $entities property from the class alongside its description. Also, I was unsuccessful trying to find ConfigFactoryInterface::getCacheKeys() method in Drupal Core, it seems outdated and $entities property is not used anywhere in the ConfigEntityStorage class.
Comment #3
joachim CreditAttribution: joachim as a volunteer commentedThanks for looking at this and for the patch.
Patch looks good, and tests pass. RTBC!
Comment #5
catchI think this is fine to remove as dead code since it's assumed to be empty anyway, and it's not the sort of thing an override of ConfigEntityStorage would deal with. The only other option would be deprecating it for removal in Drupal 10, but there's not really a way to provide bc here - any code using this would be looking in the wrong place for cached config entities. So just removal seems right. Also this isn't a base class so we're entitled to make changes to protected property.