For some reason, I get a PDOException when the formatter view it's called. It seems allowed_node_types variable's is not set.

Notice: Undefined index: allowed_node_types a autocomplete_widgets_field_formatter_view() (line 251 .../autocomplete_widgets.module).
Warning: Invalid argument supplied for foreach() a DatabaseCondition->compile() (línia 1854 de /Users/miguel/Sites/apralia/includes/database/query.inc).
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: SELECT node.nid AS entity_id, node.vid AS revision_id, node.type AS bundle, :entity_type AS entity_type FROM {node} node WHERE (node.title = :db_condition_placeholder_0) AND (node.status = :db_condition_placeholder_1) AND (type IN ()) ; Array ( [:db_condition_placeholder_0] => APBI149 [:db_condition_placeholder_1] => 1 [:entity_type] => node ) a EntityFieldQuery->execute() (línia 1136 de /Users/miguel/Sites/apralia/includes/entity.inc).

I attached a patch checks allowed_node_types variable's before the EntityFieldQuery it's executed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

while the patch looks fine .. I cannot seem to produce a situation where this error occurs. Can you tell me how to reproduce?

mordonez’s picture

Sorry I can't reproduce the error again. But it seems when I deleted the module's folder by accident I restored it again.

bleen’s picture

Status: Needs review » Closed (cannot reproduce)

I'm closing since we cannot reproduce ...

FiNeX’s picture

Status: Closed (cannot reproduce) » Active

Hi, I'm experiencing this bug using latest -dev version of autocomplete_widgets module. The patch posted by mordonez works fine :-) Thanks!

bleen’s picture

Status: Active » Fixed

Committed the patch since it seems to fix when this can be reproduced

FiNeX’s picture

Thanks bleen18 :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.