X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FForm%2FFormCache.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FForm%2FFormCache.php;h=9c931fdcae20723e37ab34034b6e19b8f27d1ada;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=7064e10fb95dd551300e8185ca56232b9b4e5db5;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Form/FormCache.php b/web/core/lib/Drupal/Core/Form/FormCache.php index 7064e10fb..9c931fdca 100644 --- a/web/core/lib/Drupal/Core/Form/FormCache.php +++ b/web/core/lib/Drupal/Core/Form/FormCache.php @@ -8,6 +8,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface; use Drupal\Core\PageCache\RequestPolicyInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Site\Settings; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -170,8 +171,8 @@ class FormCache implements FormCacheInterface { * {@inheritdoc} */ public function setCache($form_build_id, $form, FormStateInterface $form_state) { - // 6 hours cache life time for forms should be plenty. - $expire = 21600; + // Cache forms for 6 hours by default. + $expire = Settings::get('form_cache_expiration', 21600); // Ensure that the form build_id embedded in the form structure is the same // as the one passed in as a parameter. This is an additional safety measure