diff --git a/xmlsitemap_entity/xmlsitemap_entity.module b/xmlsitemap_entity/xmlsitemap_entity.module index 54d5f21..5b91ed0 100644 --- a/xmlsitemap_entity/xmlsitemap_entity.module +++ b/xmlsitemap_entity/xmlsitemap_entity.module @@ -30,7 +30,7 @@ function xmlsitemap_entity_entity_info_alter(array &$entity_info) { // Skip entities that shouldn't be handled by this module or that simply // can't be indexed. - $indexable = xmlsitemap_entity_entity_type_is_indexable(); + $indexable = xmlsitemap_entity_entity_type_is_indexable($info); if (!$indexable) { unset($info['xmlsitemap']); @@ -65,11 +65,11 @@ function xmlsitemap_entity_entity_info_alter(array &$entity_info) { * True if indexable by xmlsitemap, false otherwise. */ function xmlsitemap_entity_entity_type_is_indexable($entity_info) { - $indexable = isset($info['xmlsitemap']) - && $info['xmlsitemap'] !== FALSE - && isset($info['entity keys']['id']) - && isset($info['uri callback']) - && isset($info['access callback']); + $indexable = isset($entity_info['xmlsitemap']) + && $entity_info['xmlsitemap'] !== FALSE + && isset($entity_info['entity keys']['id']) + && isset($entity_info['uri callback']) + && isset($entity_info['access callback']); if (!$indexable) { return FALSE; @@ -77,13 +77,13 @@ function xmlsitemap_entity_entity_type_is_indexable($entity_info) { // The default Entity API uri callback is ignored unless it has been // overridden in the child class, this is checked using reflection. - if ($info['uri callback'] == 'entity_class_uri') { - if (isset($info['entity class']) && $info['entity class'] != 'Entity') { - $class = new ReflectionClass($info['entity class']); + if ($entity_info['uri callback'] == 'entity_class_uri') { + if (isset($entity_info['entity class']) && $entity_info['entity class'] != 'Entity') { + $class = new ReflectionClass($entity_info['entity class']); $default_uri = $class->getMethod('defaultUri')->getDeclaringClass()->getName(); $uri = $class->getMethod('uri')->getDeclaringClass()->getName(); - if (in_array($info['entity class'], array($default_uri, $uri))) { + if (in_array($entity_info['entity class'], array($default_uri, $uri))) { return TRUE; } }