FIX Bug with forms being cached

This commit is contained in:
Daniel Hensby 2018-06-12 17:59:56 +01:00 committed by Damian Mooyman
parent 7c875918c7
commit befd81d0c2

View File

@ -7,6 +7,7 @@ use SilverStripe\Control\Controller;
use SilverStripe\Control\HasRequestHandler; use SilverStripe\Control\HasRequestHandler;
use SilverStripe\Control\HTTP; use SilverStripe\Control\HTTP;
use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\Middleware\HTTPCacheControlMiddleware;
use SilverStripe\Control\NullHTTPRequest; use SilverStripe\Control\NullHTTPRequest;
use SilverStripe\Control\RequestHandler; use SilverStripe\Control\RequestHandler;
use SilverStripe\Control\Session; use SilverStripe\Control\Session;
@ -884,7 +885,7 @@ class Form extends ViewableData implements HasRequestHandler
// If we need to disable cache, do it // If we need to disable cache, do it
if ($needsCacheDisabled) { if ($needsCacheDisabled) {
HTTP::set_cache_age(0); HTTPCacheControlMiddleware::singleton()->disableCache();
} }
$attrs = $this->getAttributes(); $attrs = $this->getAttributes();