mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR fix failing tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@90509 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1d281472ab
commit
c33022f987
@ -39,10 +39,14 @@ abstract class CMSBatchAction extends Object {
|
||||
* @para
|
||||
*/
|
||||
public function batchaction(DataObjectSet $pages, $helperMethod, $successMessage, $arguments = array()) {
|
||||
$failures = 0;
|
||||
|
||||
foreach($pages as $page) {
|
||||
|
||||
// Perform the action
|
||||
call_user_func_array(array($page, $helperMethod), $arguments);
|
||||
if (!call_user_func_array(array($page, $helperMethod), $arguments)) {
|
||||
$failures++;
|
||||
}
|
||||
|
||||
// Now make sure the tree title is appropriately updated
|
||||
$publishedRecord = DataObject::get_by_id('SiteTree', $page->ID);
|
||||
@ -126,7 +130,7 @@ class CMSBatchAction_Delete extends CMSBatchAction {
|
||||
unset($page);
|
||||
}
|
||||
|
||||
$message = sprintf(_t('CMSBatchActions.DELETED_PAGES', 'Deleted %d pages from the draft site, %d failures'), $pages->Count()-$failures, $failures);
|
||||
$message = sprintf(_t('CMSBatchActions.DELETED_PAGES', 'Deleted %d pages from the draft site'), $pages->Count());
|
||||
FormResponse::add('statusMessage("'.$message.'","good");');
|
||||
|
||||
return FormResponse::respond();
|
||||
|
@ -8,7 +8,6 @@
|
||||
class CMSBatchActionHandler extends RequestHandler {
|
||||
static $batch_actions = array(
|
||||
'publish' => 'CMSBatchAction_Publish',
|
||||
'unpublish' => 'CMSBatchAction_Unpublish',
|
||||
'delete' => 'CMSBatchAction_Delete',
|
||||
'deletefromlive' => 'CMSBatchAction_DeleteFromLive',
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user