From befd81d0c238125b8b82dc8af69b58a1e639a6c4 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Tue, 12 Jun 2018 17:59:56 +0100 Subject: [PATCH] FIX Bug with forms being cached --- src/Forms/Form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Forms/Form.php b/src/Forms/Form.php index 84d6574a4..b2d921a34 100644 --- a/src/Forms/Form.php +++ b/src/Forms/Form.php @@ -7,6 +7,7 @@ use SilverStripe\Control\Controller; use SilverStripe\Control\HasRequestHandler; use SilverStripe\Control\HTTP; use SilverStripe\Control\HTTPRequest; +use SilverStripe\Control\Middleware\HTTPCacheControlMiddleware; use SilverStripe\Control\NullHTTPRequest; use SilverStripe\Control\RequestHandler; use SilverStripe\Control\Session; @@ -884,7 +885,7 @@ class Form extends ViewableData implements HasRequestHandler // If we need to disable cache, do it if ($needsCacheDisabled) { - HTTP::set_cache_age(0); + HTTPCacheControlMiddleware::singleton()->disableCache(); } $attrs = $this->getAttributes();