Commit d3d507ab authored by Dave Reid's avatar Dave Reid

#724272 by Dave Reid, jmpoure: Fixed endless loop during rebuilding with PostgreSQL.

parent 0bd25e4f
......@@ -454,7 +454,6 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
$bundles = xmlsitemap_get_link_type_enabled_bundles($entity);
$query->condition($info['object keys']['bundle'], $bundles);
$query->orderBy($info['object keys']['id']);
$query->addMetaData('entity', $entity);
$query->addMetaData('entity_info', $info);
......@@ -463,6 +462,9 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
$context['sandbox']['max'] = $query->countQuery()->execute()->fetchField();
// PostgreSQL cannot have the ORDERED BY in the count query.
$query->orderBy($info['object keys']['id']);
$query->range(0, variable_get('xmlsitemap_batch_limit', 100));
$ids = $query->execute()->fetchCol();
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