mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.0' into 3.1
This commit is contained in:
commit
e5ed8f1ef2
@ -973,7 +973,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
if(substr($SQL_id,0,3) != 'new') {
|
||||
$record = DataObject::get_by_id($className, $SQL_id);
|
||||
if($record && !$record->canEdit()) return Security::permissionFailure($this);
|
||||
if(!$record || !$record->ID) throw new HTTPResponse_Exception("Bad record ID #" . (int)$data['ID'], 404);
|
||||
if(!$record || !$record->ID) $this->httpError(404, "Bad record ID #" . (int)$data['ID']);
|
||||
} else {
|
||||
if(!singleton($this->stat('tree_class'))->canCreate()) return Security::permissionFailure($this);
|
||||
$record = $this->getNewItem($SQL_id, false);
|
||||
@ -994,7 +994,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
|
||||
$record = DataObject::get_by_id($className, Convert::raw2sql($data['ID']));
|
||||
if($record && !$record->canDelete()) return Security::permissionFailure();
|
||||
if(!$record || !$record->ID) throw new HTTPResponse_Exception("Bad record ID #" . (int)$data['ID'], 404);
|
||||
if(!$record || !$record->ID) $this->httpError(404, "Bad record ID #" . (int)$data['ID']);
|
||||
|
||||
$record->delete();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user