Skip to content

Commit

Permalink
BUGFIX: disable translatable filter on batch actions. Fixes #4442 (th…
Browse files Browse the repository at this point in the history
…anks to helgert)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@115156 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Will Rossiter committed Dec 17, 2010
1 parent 2d3bb7d commit 95e6516
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/CMSBatchActionHandler.php
@@ -1,11 +1,13 @@
<?php

/**
* Special request handler for admin/batchaction
*
* @package cms
* @subpackage batchaction
*/
class CMSBatchActionHandler extends RequestHandler {

static $batch_actions = array();

static $url_handlers = array(
Expand Down Expand Up @@ -80,6 +82,8 @@ function handleAction($request) {
foreach($ids as $k => $v) if(!is_numeric($v)) unset($ids[$k]);

if($ids) {
if(Object::has_extension('SiteTree','Translatable')) Translatable::disable_locale_filter();

$pages = DataObject::get(
$this->recordClass,
sprintf(
Expand All @@ -89,6 +93,8 @@ function handleAction($request) {
)
);

if(Object::has_extension('SiteTree','Translatable')) Translatable::enable_locale_filter();

if(Object::has_extension($this->recordClass, 'Versioned')) {
// If we didn't query all the pages, then find the rest on the live site
if(!$pages || $pages->Count() < sizeof($ids)) {
Expand Down

0 comments on commit 95e6516

Please sign in to comment.