Skip to content

Commit

Permalink
FIX Switching to use Controller::curr as it was using previously
Browse files Browse the repository at this point in the history
  • Loading branch information
ScopeyNZ committed Nov 30, 2018
1 parent 32d096d commit c7b5b1e
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions src/Forms/GridField/FormAction/AbstractRequestAwareStore.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
<?php
namespace SilverStripe\Forms\GridField\FormAction;

use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;

abstract class AbstractRequestAwareStore implements StateStore
{
private static $dependencies = [
'request' => '%$' . HTTPRequest::class,
];

/**
* @var HTTPRequest
*/
protected $request;

/**
* @return HTTPRequest
*/
public function getRequest()
{
return $this->request;
}

/**
* @param HTTPRequest $request
* @return $this
*/
public function setRequest($request)
{
$this->request = $request;
return $this;
// Replicating existing functionality from GridField_FormAction
return Controller::curr()->getRequest();
}
}

0 comments on commit c7b5b1e

Please sign in to comment.