Commit 7746e96d authored by Dave Reid's avatar Dave Reid

by Dave Reid: Moved xmlsitemap_query_xmlsitemap_link_bundle_access_alter() to...

by Dave Reid: Moved xmlsitemap_query_xmlsitemap_link_bundle_access_alter() to xmlsitemap.xmlsitemap.inc.
parent 2e94ea85
......@@ -69,6 +69,7 @@ function xmlsitemap_hook_info() {
'xmlsitemap_sitemap_uri_alter',
'xmlsitemap_sitemap_link_url_options_alter',
'query_xmlsitemap_generate_alter',
'query_xmlsitemap_link_bundle_access_alter',
'form_xmlsitemap_sitemap_edit_form_alter',
);
......@@ -1411,21 +1412,3 @@ function xmlsitemap_get_operation_link($url, $options = array()) {
drupal_alter('xmlsitemap_operation_link', $link);
return $link;
}
/**
* Implements hook_query_TAG_alter().
*/
function xmlsitemap_query_xmlsitemap_link_bundle_access_alter(QueryAlterableInterface $query) {
if ($entity = $query->getMetaData('entity_info')) {
$bundle = $query->getMetaData('bundle');
if (empty($bundle)) {
$bundle = xmlsitemap_get_link_type_enabled_bundles($entity);
}
if (!empty($info['bundle keys']['bundle'])) {
$query->condition($info['bundle keys']['bundle'], $bundle);
}
if (!empty($info['entity keys']['bundle'])) {
$query->condition($info['entity keys']['bundle'], $bundles);
}
}
}
......@@ -92,3 +92,21 @@ function xmlsitemap_sitemap_multiple_update(array $smids) {
$batch = xmlsitemap_regenerate_batch($smids);
batch_set($batch);
}
/**
* Implements hook_query_TAG_alter().
*/
function xmlsitemap_query_xmlsitemap_link_bundle_access_alter(QueryAlterableInterface $query) {
if ($entity = $query->getMetaData('entity_info')) {
$bundle = $query->getMetaData('bundle');
if (empty($bundle)) {
$bundle = xmlsitemap_get_link_type_enabled_bundles($entity);
}
if (!empty($info['bundle keys']['bundle'])) {
$query->condition($info['bundle keys']['bundle'], $bundle);
}
if (!empty($info['entity keys']['bundle'])) {
$query->condition($info['entity keys']['bundle'], $bundles);
}
}
}
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