mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX: Fixed ajax-response for multiple-item deletion
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@73117 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f18ace08b7
commit
cd6a6ad92d
@ -1015,6 +1015,7 @@ JS;
|
||||
}
|
||||
}
|
||||
|
||||
$oldID = $record->ID;
|
||||
$record->delete();
|
||||
$record->destroy();
|
||||
|
||||
@ -1024,13 +1025,14 @@ JS;
|
||||
$liveRecord = Versioned::get_one_by_stage( $this->stat('tree_class'), 'Live', "`{$this->stat('tree_class')}`.`ID`={$id}");
|
||||
|
||||
if($liveRecord) {
|
||||
$title = Convert::raw2js($record->TreeTitle());
|
||||
FormResponse::add("$('sitetree').setNodeTitle($record->OldID, '$title');");
|
||||
FormResponse::add("$('Form_EditForm').reloadIfSetTo($record->OldID);");
|
||||
$liveRecord->IsDeletedFromStage = true;
|
||||
$title = Convert::raw2js($liveRecord->TreeTitle());
|
||||
FormResponse::add("$('sitetree').setNodeTitle($oldID, '$title');");
|
||||
FormResponse::add("$('Form_EditForm').reloadIfSetTo($oldID);");
|
||||
} else {
|
||||
FormResponse::add("var node = $('sitetree').getTreeNodeByIdx('$id');");
|
||||
FormResponse::add("if(node && node.parentTreeNode) node.parentTreeNode.removeTreeNode(node);");
|
||||
FormResponse::add("$('Form_EditForm').reloadIfSetTo($record->OldID);");
|
||||
FormResponse::add("$('Form_EditForm').reloadIfSetTo($oldID);");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user