From eb17476b37b1a5c38352b7963050dcba3a4b73f7 Mon Sep 17 00:00:00 2001
From: Jaime Herencia <jherencia@360690.no-reply.drupal.org>
Date: Tue, 31 Jul 2012 18:16:20 +0200
Subject: [PATCH] Issue #1706664 by jherencia: Fixed wrong comprobation in
 entityreference_autocomplete_callback when no entity_id is
 defined.

---
 entityreference.module |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/entityreference.module b/entityreference.module
index 425c8aa..8edc798 100644
--- a/entityreference.module
+++ b/entityreference.module
@@ -808,7 +808,7 @@ function entityreference_autocomplete_callback($type, $field_name, $entity_type,
   }
 
   $entity = NULL;
-  if ($entity_id !== 'NULL') {
+  if ($entity_id != '') {
     $entity = entity_load_single($entity_type, $entity_id);
     if (!$entity || !entity_access('view', $entity_type, $entity)) {
       return MENU_ACCESS_DENIED;
-- 
1.7.5.4

