mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Merge pull request #184 from mlewis-everley/fix-174
Get current controller via curr() (removes pushCurrent issue)
This commit is contained in:
commit
5581c11df8
@ -16,6 +16,7 @@ use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\View\Requirements;
|
||||
use SilverStripe\Control\Controller;
|
||||
|
||||
/**
|
||||
* GridField component for editing attached models in bulk.
|
||||
@ -344,15 +345,13 @@ class BulkManager implements GridField_HTMLProvider, GridField_ColumnProvider, G
|
||||
*/
|
||||
public function handleBulkAction($gridField, $request)
|
||||
{
|
||||
$controller = $gridField->getForm()->getController();
|
||||
|
||||
$controller = Controller::curr();
|
||||
$actionUrlSegment = $request->shift();
|
||||
$handlerClass = $this->config['actions'][$actionUrlSegment];
|
||||
|
||||
$controller->pushCurrent();
|
||||
$handler = Injector::inst()->create($handlerClass, $gridField, $this);
|
||||
if ($handler)
|
||||
{
|
||||
if ($handler) {
|
||||
return $handler->handleRequest($request);
|
||||
}
|
||||
|
||||
|
@ -2,17 +2,18 @@
|
||||
|
||||
namespace Colymba\BulkUpload;
|
||||
|
||||
use Colymba\BulkUpload\BulkUploadHandler;
|
||||
use Colymba\BulkUpload\BulkUploadField;
|
||||
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\Forms\FormAction;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\View\ArrayData;
|
||||
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\Forms\FormAction;
|
||||
use SilverStripe\View\Requirements;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use Colymba\BulkUpload\BulkUploadField;
|
||||
use Colymba\BulkUpload\BulkUploadHandler;
|
||||
use SilverStripe\Forms\GridField\GridField_URLHandler;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
|
||||
/**
|
||||
* GridField component for uploading images in bulk.
|
||||
@ -331,7 +332,8 @@ class BulkUploader implements GridField_HTMLProvider, GridField_URLHandler
|
||||
*/
|
||||
public function handleBulkUpload($gridField, $request)
|
||||
{
|
||||
$gridField->getForm()->getController()->pushCurrent();
|
||||
$controller = Controller::curr();
|
||||
$controller->pushCurrent();
|
||||
$handler = new \Colymba\BulkUpload\BulkUploadHandler($gridField, $this);
|
||||
|
||||
return $handler->handleRequest($request);
|
||||
|
Loading…
Reference in New Issue
Block a user