-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX Switching to use Controller::curr as it was using previously
- Loading branch information
Showing
1 changed file
with
3 additions
and
20 deletions.
There are no files selected for viewing
23 changes: 3 additions & 20 deletions
23
src/Forms/GridField/FormAction/AbstractRequestAwareStore.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |