From 02d2cb1601f5573803cee3a45ffbe9c9e113f6ce Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 11 Aug 2014 17:28:59 +1200 Subject: [PATCH] enotice fixes --- civicrm_entity.module | 5 ++++- civicrm_entity_controller.inc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/civicrm_entity.module b/civicrm_entity.module index f2534679..013379bf 100644 --- a/civicrm_entity.module +++ b/civicrm_entity.module @@ -13,7 +13,7 @@ */ function civicrm_entity_menu_alter(&$items) { foreach (entity_get_info() as $entity_name => $entity_info) { - if ($entity_info['module'] == 'civicrm_entity') { + if (!empty($entity_info['module']) && $entity_info['module'] == 'civicrm_entity') { foreach ($entity_info['bundles'] as $file_type => $bundle_info) { if (isset($bundle_info['admin'])) { // Get the base path and access. @@ -833,6 +833,9 @@ function civicrm_entity_action_load_create_contact($user, $email = NULL) { * @throws CiviCRM_API3_Exception */ function civicrm_entity_action_load_contact($user) { + if (!civicrm_initialize()) { + return; + } $contact_id = civicrm_api3('uf_match', 'getvalue', array( 'uf_id' => $user->uid, 'return' => 'contact_id', diff --git a/civicrm_entity_controller.inc b/civicrm_entity_controller.inc index 4468aa5f..283d50cb 100644 --- a/civicrm_entity_controller.inc +++ b/civicrm_entity_controller.inc @@ -39,7 +39,7 @@ class CivicrmEntityController extends EntityAPIController { // were passed. The $ids array is reduced as items are loaded from cache, // and we need to know if it's empty for this reason to avoid querying the // database when all requested entities are loaded from cache. - $passed_ids = !empty($ids) ? array_flip($ids) : FALSE; + $passed_ids = !empty($ids) ? array_flip((array) $ids) : FALSE; // Try to load entities from the static cache, if the entity type supports // static caching. if ($this->cache && !$revision_id) {