From 3b249d85df763c1bc5c5b129957501db16fdc57b Mon Sep 17 00:00:00 2001
From: mordonez <miguel@ymbra.com>
Date: Tue, 3 Apr 2012 12:40:54 +0200
Subject: [PATCH] fixing pdoexception when allowed_no_types it's not set

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

diff --git a/autocomplete_widgets.module b/autocomplete_widgets.module
index 5ffdad9..25661d1 100755
--- a/autocomplete_widgets.module
+++ b/autocomplete_widgets.module
@@ -244,7 +244,7 @@ function autocomplete_widgets_field_formatter_view($entity_type, $entity, $field
     switch ($field['type']) {
       case 'text' :
 
-        if (isset($items[0]['value'])) {
+        if (isset($items[0]['value']) && isset($instance['widget']['settings']['allowed_node_types'])) {
           // If there exists a node with that title, display it as a link.
           $query = new EntityFieldQuery();
           $nodes = $query->entityCondition('entity_type', 'node')
-- 
1.7.6

