Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

State API shouldn't be used for caching #440

Closed
MPParsley opened this issue Dec 4, 2018 · 1 comment · Fixed by #450
Closed

State API shouldn't be used for caching #440

MPParsley opened this issue Dec 4, 2018 · 1 comment · Fixed by #450

Comments

@MPParsley
Copy link
Collaborator

MPParsley commented Dec 4, 2018

In GroupTypeManager::refreshGroupRelationMap() state API is used to cache the map:

    // Cache the map.
    $this->state->set(self::GROUP_RELATION_MAP_CACHE_KEY, $this->groupRelationMap);

We shouldn't use state for caching. It can break things when another entity type has an og_reference field (e.g. og_menu).

A simple workaround is to clear the state manually:

drush state:delete og.group_manager.group_relation_map
@pfrenssen
Copy link
Contributor

Good find! We should use the Cache API for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants