Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR added batch deletion back for workflow (from r88916) (from r96789)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102481 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 791dc22e5d048fd110b0e9e5249107b50aa40710 1 parent 3df78fd
@chillu chillu authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 code/CMSBatchAction.php
View
14 code/CMSBatchAction.php
@@ -44,7 +44,6 @@
* }
*/
public function batchaction(DataObjectSet $pages, $helperMethod, $successMessage, $arguments = array()) {
- $failures = 0;
$status = array('modified' => array(), 'error' => array());
foreach($pages as $page) {
@@ -129,7 +128,8 @@ function getActionTitle() {
function run(DataObjectSet $pages) {
$status = array(
'modified'=>array(),
- 'deleted'=>array()
+ 'deleted'=>array(),
+ 'error'=>array()
);
foreach($pages as $page) {
@@ -137,6 +137,7 @@ function run(DataObjectSet $pages) {
// Perform the action
if($page->canDelete()) $page->delete();
+ else $status['error'][$page->ID] = true;
// check to see if the record exists on the live site,
// if it doesn't remove the tree node
@@ -179,7 +180,7 @@ function run(DataObjectSet $pages) {
// Perform the action
if($page->canDelete()) $page->doDeleteFromLive();
- // check to see if the record exists on the live site, if it doesn't remove the tree node
+ // check to see if the record exists on the stage site, if it doesn't remove the tree node
$stageRecord = Versioned::get_one_by_stage( 'SiteTree', 'Stage', "\"SiteTree\".\"ID\"=$id");
if($stageRecord) {
$stageRecord->IsAddedToStage = true;
@@ -191,8 +192,15 @@ function run(DataObjectSet $pages) {
}
}
+<<<<<<< .working
return Convert::raw2json($status);
+=======
+
+ return FormResponse::respond();
+>>>>>>> .merge-right.r96789
}
}
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.