Details
-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 4.6.3
-
Fix Version/s: Unscheduled
-
Component/s: None
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
Issues
There appear to be a number of issues in the caching system, two particularly affect in-progress event registrations and donations (transactions).
1) The admin action ‘Cleanup caches’ destroys in-progress sessions for transactions because it truncates civicrm_cache.
Steps to recreate: Start an event registration with a confirmation page. Move on in the process, and then clear the caches. Go back or continue on the form results in a fatal error: 'Could not find a valid value for ID'
2) The CRM/Core/BAO/Cache->cleanup() method seems to be run on many page requests. This function appears to generate a random number and has a 0.13% chance of clearing old transactions from the cache (more than 30 minutes old). This seems really bizarre.
Steps to observe: Place a dsm() or print() into the cleanup() method to see how often it is run.
Why resolve
The issue only manifests itself for us because some of our event registration forms can actually take more than 30 minutes to complete (if a user is referring to a printed programme at the time). As a workaround we can just increase the cache timeout for transactions, defined in cleanup().
However, it feels like the way caching is handled in Civi should be centralised better; and probably not triggered ‘randomly’ by standard page requests, with the cache lifetime defined in code.
Proposed solution
I may put together a wiki page with a full proposal, but some ideas to step in the right direction:
- Remove fatal error for timed-out event transactions; mirror the contribution form which displays the ‘your session has expired’ message
- Remove the cleanup() method that is randomly called
- Only clear caches using the scheduled job which has been designed for the process
- Make cache lifetimes configurable, or inherit session times from the CMS
- Give admins safe and full cache reset options, the former wouldn’t erase in-progress transactions, the latter would display a warning that in-progress transactions will be erased
Attachments
Issue Links
- is supplemented by
-
CRM-13102 Event Registration fails with "We can't load the requested web page. This page requires cookies to be enabled..."
- Done/Fixed