Commit 0a12cd4a authored by totten's avatar totten

(#174) Forms/Sessions - Clear in roughly the same ways as before

In the past, if one clears the `civicrm_cache` table (i.e.  by calling
`CRM_Core_Config::clearDBCache()` ==> `TRUNCATE TABLE civicrm_cache`), then it
has the effect of destroying any active sessions/forms.

Now, in allowing sessions to be stored elsewhere, we lose that side-effect.

If we want strictly equivalent behavior (from a business-logic perspective),
then we'd want the patch to go a bit further -- calling
Civi::cache('session')->clear() at the same time that it does
`clearDBCache()`.

This revision adds `clear()` calls to various spots discussed here:

* https://docs.google.com/spreadsheets/d/1FxuIvr2noelBvhu5eja9_ps3YUWnkmGhqijBO3gH8Po/edit?usp=sharing
* https://github.com/civicrm/civicrm-core/pull/12362#issuecomment-400897782
parent 19707a63
......@@ -233,6 +233,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
}
CRM_Core_Config::clearDBCache();
Civi::cache('session')->clear(); // This doesn't make a lot of sense to me, but it maintains pre-existing behavior.
CRM_Utils_System::flushCache();
CRM_Core_Resources::singleton()->resetCacheCode();
......
......@@ -65,6 +65,7 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting
// clear all caches
CRM_Core_Config::clearDBCache();
Civi::cache('session')->clear();
CRM_Utils_System::flushCache();
parent::rebuildMenu();
......
......@@ -260,6 +260,7 @@ class CRM_Core_BAO_ConfigSetting {
// clear all caches
CRM_Core_Config::clearDBCache();
Civi::cache('session')->clear();
$moveStatus .= ts('Database cache tables cleared.') . '<br />';
$resetSessionTable = CRM_Utils_Request::retrieve('resetSessionTable',
......
......@@ -295,6 +295,7 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge {
// clear all caches
self::clearDBCache();
Civi::cache('session')->clear();
CRM_Utils_System::flushCache();
if ($sessionReset) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment