joomlatools / joomlatools-framework

Modern PHP extension framework (for Joomla)
https://www.joomlatools.com/developer/framework/
GNU General Public License v3.0
19 stars 11 forks source link

Extensions settings and Joomla's cache #712

Open amazeika opened 3 months ago

amazeika commented 3 months ago

When Joomla's cache is enabled, extension setting changes get saved BUT Joomla's cache is not renewed. This is most likely because when we save settings, these are updated using a model entity instead of the Joomla API for this matter.

We should take a closer look at this and at the very least attempt to invalidate the config cache after updating the extension settings.

Support tickets

jebbdomingo commented 3 months ago

@amazeika We can clean the system cache after editing the config.

$this->addCommandCallback('after.edit',   '_clearCache');

protected function _clearCache()
{
      JFactory::getCache('_system', 'output')->clean();
}

and also in the installer helper

protected function _clearCache()
{
      ...
      JFactory::getCache('_system', 'output')->clean();
      ...
}