Commit 6e6ec48d authored by Dave Reid's avatar Dave Reid

by Dave Reid: Added hook_query_xmlsitemap_link_bundle_access_alter() for any...

by Dave Reid: Added hook_query_xmlsitemap_link_bundle_access_alter() for any queries selecting from an entity's base table and the bundle value is in another table (e.g. vocabulary machine name for taxonomy terms).
parent 05a253c8
......@@ -529,13 +529,10 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
}
$info = $context['sandbox']['info'];
$query = db_select($info['base table']);
$query->addField($info['base table'], $info['entity keys']['id']);
$query = db_select($info['base table'], 'base');
$query->addField('base', $info['entity keys']['id']);
$query->condition($info['entity keys']['id'], $context['sandbox']['last_id'], '>');
if (!empty($info['entity keys']['bundle'])) {
$bundles = xmlsitemap_get_link_type_enabled_bundles($entity);
$query->condition($info['entity keys']['bundle'], $bundles);
}
$query->addTag('xmlsitemap_link_bundle_access');
$query->addTag('xmlsitemap_rebuild');
$query->addMetaData('entity', $entity);
$query->addMetaData('entity_info', $info);
......
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