BUGFIX: disable translatable filter on batch actions. Fixes #4442 (thanks to helgert)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@115156 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2010-12-17 01:01:12 +00:00
parent 2d3bb7de3e
commit 95e6516e61

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Special request handler for admin/batchaction * Special request handler for admin/batchaction
* *
@ -6,6 +7,7 @@
* @subpackage batchaction * @subpackage batchaction
*/ */
class CMSBatchActionHandler extends RequestHandler { class CMSBatchActionHandler extends RequestHandler {
static $batch_actions = array(); static $batch_actions = array();
static $url_handlers = array( static $url_handlers = array(
@ -80,6 +82,8 @@ class CMSBatchActionHandler extends RequestHandler {
foreach($ids as $k => $v) if(!is_numeric($v)) unset($ids[$k]); foreach($ids as $k => $v) if(!is_numeric($v)) unset($ids[$k]);
if($ids) { if($ids) {
if(Object::has_extension('SiteTree','Translatable')) Translatable::disable_locale_filter();
$pages = DataObject::get( $pages = DataObject::get(
$this->recordClass, $this->recordClass,
sprintf( sprintf(
@ -89,6 +93,8 @@ class CMSBatchActionHandler extends RequestHandler {
) )
); );
if(Object::has_extension('SiteTree','Translatable')) Translatable::enable_locale_filter();
if(Object::has_extension($this->recordClass, 'Versioned')) { if(Object::has_extension($this->recordClass, 'Versioned')) {
// If we didn't query all the pages, then find the rest on the live site // If we didn't query all the pages, then find the rest on the live site
if(!$pages || $pages->Count() < sizeof($ids)) { if(!$pages || $pages->Count() < sizeof($ids)) {