This commit is contained in:
Russ Michell 2018-06-05 03:37:21 +00:00 committed by GitHub
commit ad74798b33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@ use SilverStripe\ORM\ValidationResult;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Injector\Injector;
/**
* Generic RESTful server, which handles webservice access to arbitrary DataObjects.
@ -571,7 +572,8 @@ class RestfulServer extends Controller
if (!singleton($className)->canCreate($this->getMember())) {
return $this->permissionFailure();
}
$obj = new $className();
$obj = Injector::inst()->create($className);
$reqFormatter = $this->getRequestDataFormatter($className);
if (!$reqFormatter) {