Commit c59f5b6d authored by Dave Reid's avatar Dave Reid

by Dave Reid: Prevent batch processing when there are no links to process.

parent d3d507ab
......@@ -460,6 +460,10 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
if (!isset($context['sandbox']['max'])) {
$context['sandbox']['max'] = $query->countQuery()->execute()->fetchField();
if (!$context['sandbox']['max']) {
// If there are no items to process, skip everything else.
return;
}
}
// PostgreSQL cannot have the ORDERED BY in the count query.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment