1

When trying to preview a view containing references to three Field Collection module fields, I get the following error:

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 'AS node_, node.created AS node_created, 'field_collection_item' AS field_data_fi' at line 1

Here is the full attempted query:

SELECT field_collection_item_field_data_field_obit_service.item_id AS field_collection_item_field_data_field_obit_service_item_id, node. AS node_, node.created AS node_created, 'field_collection_item' AS field_data_field_service_location_field_collection_item_enti, 'field_collection_item' AS field_data_field_service_time_field_collection_item_entity_t, '' AS field_data_field_service_type__entity_type FROM {node} node LEFT JOIN {field_data_field_obit_service} field_data_field_obit_service ON node.nid = field_data_field_obit_service.entity_id AND (field_data_field_obit_service.entity_type = 'node' AND field_data_field_obit_service.deleted = '0') INNER JOIN {field_collection_item} field_collection_item_field_data_field_obit_service ON field_data_field_obit_service.field_obit_service_value = field_collection_item_field_data_field_obit_service.item_id WHERE (( (node.status = '1') )) ORDER BY node_created DESC LIMIT 5 OFFSET 0

I don't know sql that well, but it appears as though some of the references are being truncated due to length. Also there is a reference to an empty string ('') as a column name. Any idea what's wrong and how to correct it?

2
  • 1
    I believe the column names are the issue - node. and ''.
    – mradcliffe
    Apr 22, 2016 at 20:01
  • Thanks. It's working after I removed and re-added the fields. Maybe it was just a momentary glitch.
    – AndrewE
    Apr 22, 2016 at 20:14

1 Answer 1

0

Removing the fields and then adding them back resolved the issue, though I'm not sure how.

Not the answer you're looking for? Browse other questions tagged or ask your own question.