This has just bitten me - pretty sure it's a bug in the export class. Changing the getTotal function in /manager/includes/extenders/export.class.php from this:
function getTotal($ignore_ids='', $noncache='0')
{
global $modx;
$tbl_site_content = $modx->getFullTableName('site_content');
$ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids)));
if(count($ignore_ids)>0)
{
$ignore_ids = "AND NOT id IN ('".implode("','", $ignore_ids)."')";
}
$this->ignore_ids = $ignore_ids;
$noncache = $include_noncache==1 ? '' : 'AND cacheable=1';
$where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}";
$rs = $modx->db->select('count(id)',$tbl_site_content,$where);
$this->total = $modx->db->getValue($rs);
return $this->total;
}
to this fixes it for me:
function getTotal($ignore_ids='', $noncache='0')
{
global $modx;
$tbl_site_content = $modx->getFullTableName('site_content');
if ($ignore_ids != '') {
$ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids)));
if(count($ignore_ids)>0)
{
$ignore_ids = "AND NOT id IN ('".implode("','", $ignore_ids)."')";
}
$this->ignore_ids = $ignore_ids;
}
$noncache = $noncache==1 ? '' : 'AND cacheable=1';
$where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}";
$rs = $modx->db->select('count(id)',$tbl_site_content,$where);
$this->total = $modx->db->getValue($rs);
return $this->total;
}
Also, I'm not sure where `$include_noncache` is supposed to be set? I think this line should be changed like that, but I didn't test that part too much.