Remove DataModel and Object to work with SS4 (#148)

This commit is contained in:
Philipp Staender 2017-08-03 11:12:21 +02:00 committed by Thierry François
parent 5d8a1c3abd
commit fc86512ec9
3 changed files with 3 additions and 5 deletions

View File

@ -10,7 +10,6 @@ use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
use SilverStripe\Forms\GridField\GridField_ColumnProvider;
use SilverStripe\Forms\GridField\GridField_URLHandler;
use SilverStripe\ORM\DataModel;
use SilverStripe\View\ArrayData;
use SilverStripe\View\Requirements;
@ -368,7 +367,7 @@ class BulkManager implements GridField_HTMLProvider, GridField_ColumnProvider, G
//print_r('matched ' . $handlerClass . ' to ' . $rule);
$handler = Injector::inst()->create($handlerClass, $gridField, $this, $controller);
return $handler->handleRequest($request, DataModel::inst());
return $handler->handleRequest($request);
}
}
}

View File

@ -8,7 +8,6 @@ use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
use SilverStripe\Forms\GridField\GridField_URLHandler;
use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\DataObject;
use SilverStripe\View\ArrayData;
use SilverStripe\View\Requirements;
@ -466,6 +465,6 @@ class BulkUploader implements GridField_HTMLProvider, GridField_URLHandler
$controller = $gridField->getForm()->getController();
$handler = new \Colymba\BulkUpload\BulkUploaderRequest($gridField, $this, $controller);
return $handler->handleRequest($request, DataModel::inst());
return $handler->handleRequest($request);
}
}

View File

@ -136,7 +136,7 @@ class BulkUploaderRequest extends RequestHandler
// 1. DataObject
//create record
$recordClass = $this->component->getRecordClassName($this->gridField);
$record = Object::create($recordClass);
$record = $recordClass::create();
$record->write();
// passes the current gridfield-instance to a call-back method on the new object