diff --git a/xmlsitemap_entity/xmlsitemap_entity.module b/xmlsitemap_entity/xmlsitemap_entity.module index e919f6d..9e081ef 100644 --- a/xmlsitemap_entity/xmlsitemap_entity.module +++ b/xmlsitemap_entity/xmlsitemap_entity.module @@ -294,3 +294,18 @@ function _xmlsitemap_entity_xmlsitemap_update_link($entity_type, $entity) { xmlsitemap_link_save($entity->xmlsitemap); } + +/** + * Implements hook_entity_query_alter(). + * + * @todo Remove when https://www.drupal.org/node/1054168 is fixed. + */ +function xmlsitemap_entity_entity_query_alter($query) { + $conditions = &$query->entityConditions; + if (isset($conditions['entity_type']) && isset($conditions['bundle'])) { + $entity_info = entity_get_info($conditions['entity_type']); + if ($entity_info && !empty($entity_info['entity keys']['bundle'])) { + unset($conditions['bundle']); + } + } +}