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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz created an issue. See original summary.

bojanz credited joachim.

bojanz’s picture

Crediting joachim whose code I'm adapting.

bojanz’s picture

Status: Active » Needs review
FileSize
8.16 KB

  • bojanz committed 4c162ab on 8.x-2.x
    Issue #3096916 by bojanz, joachim: Generate reverse relationships for...
bojanz’s picture

Status: Needs review » Fixed

Replaced t() with $this->t() and committed.

  • bojanz committed b14ff49 on 8.x-2.x
    Issue #3096916 followup: Remove deprecated method usage. Get table names...
bojanz’s picture

Status: Fixed » Closed (fixed)

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

jsacksick’s picture

This 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).