Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Right now you can't create a user view and then add a relationship from the user to the products that they authored, or orders that they made. This is because core generates reverse relationships only for configurable fields, not base ones.
A core issue exists at #2706431: provide Views reverse relationships automatically for entity base fields, but looks like it's not getting in any time soon, so let's pull that code into CommerceEntityViewsData.
Comment | File | Size | Author |
---|---|---|---|
#4 | 3096916-4-reverse-relationships.patch | 8.16 KB | bojanz |
|
Comments
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedCrediting joachim whose code I'm adapting.
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedComment #6
bojanz CreditAttribution: bojanz at Centarro commentedReplaced t() with $this->t() and committed.
Comment #8
bojanz CreditAttribution: bojanz at Centarro commentedComment #10
jsacksick CreditAttribution: jsacksick at Centarro commentedThis code should probably be limited to fields provided by Commerce (See #3126828: Entity views fatal error on lingotek metadata field after upgrading from commerce 2.15 to 2.16).