From 9384296de36f679c57cfcfbfe79bc68aaee5256c Mon Sep 17 00:00:00 2001 From: "Dmitriy.trt" Date: Tue, 11 Oct 2011 23:41:30 +0700 Subject: [PATCH] Issue #1305956: fix strict warning when loading entity in hook_init() --- taxonomy_menu_trails.module | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/taxonomy_menu_trails.module b/taxonomy_menu_trails.module index 8c2617b..0baa146 100644 --- a/taxonomy_menu_trails.module +++ b/taxonomy_menu_trails.module @@ -77,7 +77,8 @@ function taxonomy_menu_trails_init() { case 'node': if (is_numeric(arg(1))) { $entity_type = 'node'; - $entity = reset(entity_load($entity_type, array(arg(1)))); + $entities = entity_load($entity_type, array(arg(1))); + $entity = reset($entities); } break; //TODO other entity types support @@ -118,7 +119,8 @@ function taxonomy_menu_trails_init() { $conditions[$title_key] = $placeholder_value; break; } - $entity = reset(entity_load($entity_type, $ids, $conditions)); + $entities = entity_load($entity_type, $ids, $conditions); + $entity = reset($entities); if (!empty($entity)) { // Entity found, set current page as entity path and break all loops. list($settings) = _taxonomy_menu_trails_get_settings($entity_type, $bundle, FALSE); -- 1.7.6.3