Commit 3f6afe74 authored by blacklabel_tom's avatar blacklabel_tom Committed by pifagor

Issue #2985257 by blacklabel_tom, rivimey, alex_optim, pifagor: Remove...

Issue #2985257 by blacklabel_tom, rivimey, alex_optim, pifagor: Remove deprecated db_and and db_or from hook_query_xmlsitemap_generate_alter example
parent 3d545fb4
......@@ -260,12 +260,12 @@ function hook_xmlsitemap_root_attributes_alter(array &$attributes, \Drupal\xmlsi
function hook_query_xmlsitemap_generate_alter(QueryAlterableInterface $query) {
$sitemap = $query->getMetaData('sitemap');
if (!empty($sitemap->context['vocabulary'])) {
$node_condition = db_and();
$node_condition = $query->andConditionGroup();
$node_condition->condition('type', 'taxonomy_term');
$node_condition->condition('subtype', $sitemap->context['vocabulary']);
$normal_condition = db_and();
$normal_condition = $query->andConditionGroup();
$normal_condition->condition('type', 'taxonomy_term', '<>');
$condition = db_or();
$condition = $query->orConditionGroup();
$condition->condition($node_condition);
$condition->condition($normal_condition);
$query->condition($condition);
......
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