Download & Extend

Views integration issue - probably relations described incorrectly for product_reference

Project:Drupal Commerce
Version:7.x-1.x-dev
Component:Product reference
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I have a node View, which pulls product through Relationship with referenced product. This works well.

Where it fails - my product (CD) have product reference fields (Tracks) and these would not pull through Relationship. After looking into actual SQL query run on DB, I think there is minor bug with declaration, although I am not too good with Views, so please review attached patch and let me know what do you think.

View I am using also attached.

AttachmentSizeStatusTest resultOperations
product_reference_views.patch1.27 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch product_reference_views.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test
albums_tracks_view.txt10.18 KBIgnored: Check issue status.NoneNone

Comments

#1

Status:needs review» needs work

The last submitted patch, product_reference_views.patch, failed testing.

#2

another try with patch to pass auto test.

AttachmentSizeStatusTest resultOperations
product_reference_views.patch1.29 KBIdlePASSED: [[SimpleTest]]: [MySQL] 3,567 pass(es).View details | Re-test

#3

Status:needs work» needs review

product_reference_views.patch queued for re-testing.

#4

Can you post an export of the View used to generate the error and the product type configuration we should have to test this out?

#5

Status:needs review» postponed (maintainer needs more info)

@scrypt : you can use Features and Commerce features to export all the configurations Ryan (rszrama) asked for.

#6

The current implementation does seem incorrect - but the problem would on present itself when using a product_reference field on a product bundle. I agree with #2, but at the same time it really is a (minor) API change. However, I tried to create situations where this patch could break stuff and I didn't came across anything.

#7

Version:7.x-1.3» 7.x-1.x-dev

I think I get the second hunk, but I'm not so sure about the first. For the field schema, the entity_id is the ID of the entity the product reference field is attached to. So it seems like you're be trying to join from the left product_id to the right nid (or whatever ID of the entity the field is on). Are we sure it isn't correct to have it joining to the [field_name]_product_id in the first hunk?