Skip to content

Commit

Permalink
enotice fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Aug 11, 2014
1 parent fc7883d commit 02d2cb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion civicrm_entity.module
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion civicrm_entity_controller.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 02d2cb1

Please sign in to comment.