-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
Don't clear sessions when clearing cache #29610
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
CRM/Core/Config.php
Outdated
Civi::cache('session')->clear(); | ||
// [ML] SYMBIOTIC This causes problems if people are filling-in quickform | ||
// forms during a system.flush | ||
// Civi::cache('session')->clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this context, it receives the param $sessionReset
. Notwithstanding the method-signature here, the actual/typical default should FALSE
. (For purposes of cv flush
, System.flush
, civicrm/menu/rebuild
, etc -- they all call via rebuildMenuAndCaches(...$sessionReset=FALSE)
). It seems better to abide that flag, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we change the param $sessionReset = FALSE
by default, then add an "if" around Civi::cache('session')->clear()
, then yes, it works as intended I think.
Tested with:
cv flush
- "flush cache" from the admin UI
cv api system.flush session=1
=> will flush the QF cache (sessionReset=true)
Thanks @MegaphoneJon 👏🏻 |
At the Montreal sprint @MegaphoneJon and I agreed that we should get this into core. Quite a few of us have been running versions of this on client sites for quite a long time. |
This would be great. Thank you for pushing this forward. I did a bit more testing based on Tim's comment, and I think it would be sensible to:
We can also strip most the comments out of the patch (ex: "ML SYMBIOTIC"). |
9ac8f93
to
ecf7b3b
Compare
I took the liberty of applying the changes to the patch. |
Thanks @bgm. @MegaphoneJon what do you think of the updates? |
LGTM |
Overview
Clearing cache shouldn't break donations in progress, but it does.
Before
See above.
After
Nope
Comments
Original patch from @mlutfy with modifications to clear most, but not all, of
civicrm_cache
.