Commit 841c098f authored by Dries's avatar Dries

- Modified patch #230374 by killes, jakeg, Eaton et al: corrected problem with...

- Modified patch #230374 by killes, jakeg, Eaton et al: corrected problem with form API caches not being flushed.  This could lead to performance issues.
parent 6ab93466
......@@ -232,11 +232,12 @@ function form_get_cache($form_build_id, &$form_state) {
* Store a form in the cache
*/
function form_set_cache($form_build_id, $form, $form_state) {
$expire = max(ini_get('session.cookie_lifetime'), 86400);
// 6 hours cache life time for forms should be plenty.
$expire = 21600;
cache_set('form_' . $form_build_id, $form, 'cache_form', $expire);
cache_set('form_' . $form_build_id, $form, 'cache_form', time() + $expire);
if (!empty($form_state['storage'])) {
cache_set('storage_' . $form_build_id, $form_state['storage'], 'cache_form', $expire);
cache_set('storage_' . $form_build_id, $form_state['storage'], 'cache_form', time() + $expire);
}
}
......
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