Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache clearing option for the JumpMenu #623

Closed
litzinger opened this issue Nov 9, 2020 · 2 comments
Closed

Add cache clearing option for the JumpMenu #623

litzinger opened this issue Nov 9, 2020 · 2 comments

Comments

@litzinger
Copy link
Contributor

The clear_caching function lumps the Jump Menu clearing in with the all option. For backwards compatibly, if an add-on needs to clear the Jump Menu cache, it has to call ee()->functions->clear_caching('all');, which may nuke too much of the cache. To make it compatible with EE 5 and 6, and give add-ons the option of clearing just the Jump Menu cache, what if the following change is made?

public function clear_caching($which, $sub_dir = '')
{
    $options = array('page', 'db', 'tag', 'sql');

    if (in_array($which, $options))
    {
        ee()->cache->delete('/'.$which.'_cache/');
    }
    elseif ($which === 'jumpmenu')
    {
        ee('CP/JumpMenu')->clearAllCaches();
    }
    elseif ($which === 'all')
    {
        foreach ($options as $option)
        {
            ee()->cache->delete('/'.$option.'_cache/');
        }
        ee('CP/JumpMenu')->clearAllCaches();
    }
}

This would make it so an add-on could call ee()->functions->clear_caching('jumpmenu'); and in EE 5, nothing happens, but in EE 6, just the jumpmenu cache folder is deleted.

@litzinger litzinger added the enhancement New feature or request label Nov 9, 2020
@intoeetive intoeetive added EE6 enhancement: accepted and removed enhancement New feature or request labels Dec 25, 2020
@intoeetive
Copy link
Contributor

@litzinger we'll add this for 6.0.1

@intoeetive intoeetive added this to the 6.0.1 milestone Jan 21, 2021
@ops-andy
Copy link
Contributor

fixed in 6.0.1

intoeetive pushed a commit that referenced this issue Oct 5, 2021
ensure Structure live preview hook is always run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants