Unverified Commit 9d7dd1fc authored by Dave Reid's avatar Dave Reid Committed by Dave Reid
Browse files

Issue #2940681 by fgm, Dave Reid: Fixed query in...

Issue #2940681 by fgm, Dave Reid: Fixed query in xmlsitemap_xmlsitemap_index_links() did not add bundle condition properly for all entity types.
parent ec2f765f
...@@ -1600,8 +1600,9 @@ function xmlsitemap_xmlsitemap_index_links($limit) { ...@@ -1600,8 +1600,9 @@ function xmlsitemap_xmlsitemap_index_links($limit) {
try { try {
$query = \Drupal::entityTypeManager()->getStorage($entity_type_id)->getQuery(); $query = \Drupal::entityTypeManager()->getStorage($entity_type_id)->getQuery();
$query->range(0, $limit); $query->range(0, $limit);
if ($entity_type->get('type')) { if ($entity_type->hasKey('bundle')) {
$query->condition('type', $entity_bundles, 'IN'); $bundle_key = $entity_type->getKey('bundle');
$query->condition($bundle_key, $entity_bundles, 'IN');
} }
$ids = $query->execute(); $ids = $query->execute();
xmlsitemap_xmlsitemap_process_entity_links($entity_type_id, $ids); xmlsitemap_xmlsitemap_process_entity_links($entity_type_id, $ids);
......
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