hello,

After module and core updates, i noticed that my product catalog is not showing products. If i go to edit my view i see error msg: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'on clause'

Before everything worked fine. I think the problem has something to do with Product referencing and entity

Thank you

CommentFileSizeAuthor
Untitled-1.jpg410.12 KBrtrebu

Comments

rtrebu’s picture

Issue summary: View changes
rszrama’s picture

Category: Bug report » Support request
Status: Active » Closed (cannot reproduce)

There isn't enough information here for us to advise - for example, what updates did you just perform? The Commerce module itself? Other things? Your best bet would be to provide a full description of what resulted in the breakage and to turn on the SQL log to actually post the query instead of the screenshot to http://www.drupalcommerce.org/questions. Thanks!

svn7svn’s picture

It's think there's some interaction between views and entity reference.

i'm working on a view in which I need to pull in some location data to the view and when I added the reference I got the same SQL error message.

Query	
SELECT users.uid AS uid, users.name AS users_name, profile_users.pid AS profile_users_pid, location.country AS country_code_sort, 'profile2' AS field_data_field_phone_number_profile2_entity_type, 'profile2' AS field_data_field_school_address_profile2_entity_type
FROM 
{users} users
INNER JOIN {profile} profile_users ON users.uid = profile_users.uid AND profile_users.type = 'instructor_profiles'
LEFT JOIN {users} users_profile ON profile_users.uid = users_profile.uid
LEFT JOIN {node} node_gallery_ref_1_node ON entity_id = node_gallery_ref_1_node.nid
LEFT JOIN {field_data_field_school_address} profile_users__field_data_field_school_address ON profile_users.pid = profile_users__field_data_field_school_address.entity_id AND (profile_users__field_data_field_school_address.entity_type = 'profile2' AND profile_users__field_data_field_school_address.deleted = '0')
LEFT JOIN {location} location_field_data_field_school_address ON profile_users__field_data_field_school_address.field_school_address_lid = location_field_data_field_school_address.lid
LEFT JOIN {location_instance} location_instance ON users.uid = location_instance.uid
LEFT JOIN {location} location ON location_instance.lid = location.lid
ORDER BY country_code_sort ASC
Title	Instructors Directory
Path	instructors-directory

interestingly enough, if I move the entity reference down one row in the relationship column (to last place) the error message disappears.

Query	
SELECT users.uid AS uid, users.name AS users_name, profile_users.pid AS profile_users_pid, location.country AS country_code_sort, 'profile2' AS field_data_field_phone_number_profile2_entity_type, 'profile2' AS field_data_field_school_address_profile2_entity_type
FROM 
{users} users
INNER JOIN {profile} profile_users ON users.uid = profile_users.uid AND profile_users.type = 'instructor_profiles'
LEFT JOIN {users} users_profile ON profile_users.uid = users_profile.uid
LEFT JOIN {field_data_field_school_address} profile_users__field_data_field_school_address ON profile_users.pid = profile_users__field_data_field_school_address.entity_id AND (profile_users__field_data_field_school_address.entity_type = 'profile2' AND profile_users__field_data_field_school_address.deleted = '0')
LEFT JOIN {location} location_field_data_field_school_address ON profile_users__field_data_field_school_address.field_school_address_lid = location_field_data_field_school_address.lid
LEFT JOIN {location_instance} location_field_data_field_school_address__location_instance ON location_field_data_field_school_address.lid = location_field_data_field_school_address__location_instance.lid
LEFT JOIN {location_instance} location_field_data_field_school_address_location_field_data_field_school_address__location_instance ON location_field_data_field_school_address.lid = location_field_data_field_school_address_location_field_data_field_school_address__location_instance.lid
LEFT JOIN {node} location_field_data_field_school_address__node ON location_field_data_field_school_address__location_instance.vid = location_field_data_field_school_address__node.vid
LEFT JOIN {node} location_field_data_field_school_address_location_field_data_field_school_address__node ON location_field_data_field_school_address__location_instance.vid = location_field_data_field_school_address_location_field_data_field_school_address__node.vid
LEFT JOIN {field_data_node_gallery_ref_1} location_field_data_field_school_address__field_data_node_gallery_ref_1 ON location_field_data_field_school_address__node.nid = location_field_data_field_school_address__field_data_node_gallery_ref_1.node_gallery_ref_1_target_id AND (location_field_data_field_school_address__field_data_node_gallery_ref_1.entity_type = 'node' AND location_field_data_field_school_address__field_data_node_gallery_ref_1.deleted = '0')
LEFT JOIN {node} node_gallery_ref_1_node ON location_field_data_field_school_address__field_data_node_gallery_ref_1.entity_id = node_gallery_ref_1_node.nid
LEFT JOIN {location_instance} location_instance ON users.uid = location_instance.uid
LEFT JOIN {location} location ON location_instance.lid = location.lid
ORDER BY country_code_sort ASC
LIMIT 10 OFFSET 0
Title	Instructors Directory
Path	instructors-directory

unfortunately for me, I still can't get my view to work the way I need it to but hopefully this helps the developers...

svn7svn’s picture

Status: Closed (cannot reproduce) » Needs review
rszrama’s picture

Status: Needs review » Closed (cannot reproduce)

That's as good a lead as any, but can you repost it using a fresh issue in the Entity Reference Field queue?

svn7svn’s picture

will do!