Was trying to use 'quick edit' at 'admin/commerce/products', but t was showing nothing.

At views page I noticed this 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 commerce_product_, commerce_product.title AS commerce_product_title, commerce' at line 1

And this error is caused by this query:

SELECT commerce_product. AS commerce_product_, commerce_product.title AS commerce_product_title, commerce_product.sku AS commerce_product_sku, commerce_product.product_id AS product_id, '' AS field_data_field_images__entity_type
FROM 
{commerce_product} commerce_product
LEFT JOIN {field_data_field_product} field_data_field_product ON commerce_product.product_id = field_data_field_product.field_product_product_id AND field_data_field_product.deleted = '0'
INNER JOIN {node} node_field_data_field_product ON field_data_field_product.entity_id = node_field_data_field_product.nid
WHERE (( (node_field_data_field_product.nid = '15' ) ))

Its really strange because I haven`t chaged anything in this view, but the query is different from default..

Comments

bojanz’s picture

Category: bug » support
Status: Active » Fixed

Your view has a broken relationship from node to product.
Maybe because you have a nonstandard product reference field (it might not be called "field_product" on your machine).

Try reverting the view, if that fails, edit it and fix it manually (by adding the relationship).

lanzs’s picture

Thanks for response!
Yes, broken relationship caused problems. For now its solved.

Status: Fixed » Closed (fixed)

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