- Merge request !71feat: #3558020 Poor cacheability of the permissions_by_term_node_grants method β (Open) created by dench0
Poor cacheability of the permissions_by_term_node_grants method because of the mistake in the AccessStorage::getGids method.
The $grants variable is initialized with the NULL value and this NULL value can be set to the local cache $this->grantsCache[$user->id()].
On the next run, it's checking if the grants were already processed with this code
if (!empty($this->grantsCache[$user->id()])) {
return $this->grantsCache[$user->id()];
}
So the method will run multiple times in case of $this->grantsCache[$user->id()] value is NULL.
Initialize value with an empty array and replace !empty checking with the isset.
Active
3.1
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.