Views integration is broken for multi-value reference fields defined as base fields.

The following fields are created as configurable fields because of that:
- stores (commerce_product)
- variations (commerce_product)
- line_items (commerce_order)

If/once the issue gets fixed, those fields should be reverted to base fields.

Core issues: #2477899: Multiple valued Base fields won't work in Views, #2337515: Allow @FieldType to customize views data.
Initially documented in: #2421537-11: Convert subscriptions field to a base field

Comments

vasike’s picture

Title: Move Entity reference base fields to Configurable fields » Move unlimited Entity base fields to Configurable fields
Status: Active » Needs review

https://github.com/commerceguys/commerce/pull/171
and there is the pull request for this - it's about Store currencies & Order line items.

There are some changes: use "line_item" and "currency" for the field names
instead "line_items" & "currencies"

There was an issue with the email widget. There is also fix for this.

googletorp’s picture

Would it be better to fix Views?

bojanz’s picture

@googletorp
Berdir calls the change "unlikely to happen at this point", so I'd rather switch the fields back in 6 months than spend time on a dead end.

bojanz’s picture

Status: Needs review » Fixed

Merged.

dwkitchen’s picture

Title: Move unlimited Entity base fields to Configurable fields » Convert line_item field to base field [Blocked by Views]
Issue summary: View changes
Status: Fixed » Needs work
Related issues: +#2421537: Convert subscriptions field to a base field

I have moved this to needs work to identify the need to return these to Base field definitions once views has been fixed.

Otherwise when a new order type is created it won't have a line-item reference field and will brake the expected order functionality.

  • vasike committed 6cbe0ad on 8.x-2.x
    Issue #2466893 by bojanz, vasike: Move unlimited Entity reference base...
  • bojanz committed 7f177a6 on 8.x-2.x
    Merge pull request #171 from vasike/8.x-2.x-unlimited-entity-reference...
bojanz’s picture

Title: Convert line_item field to base field [Blocked by Views] » Convert multi-value configurable reference fields to base fields
Issue summary: View changes
Status: Needs work » Postponed
bojanz’s picture

Status: Postponed » Active

The main part of the fix (#2644088: DefaultTableMapping::getFieldTableName does not report table for fields with dedicated storage) is in Drupal 8.1.0.
The remaining work (#2477899) is small.
We should push that patch, and do this conversion before alpha5/beta1.

fenstrat’s picture

#2477899: Multiple valued Base fields won't work in Views is in core for both 8.1 and 8.2. So this should mostly be a matter of reverting #6 right?

bojanz’s picture

We also need #2337515: Allow @FieldType to customize views data in order to have Views integration.

fenstrat’s picture

Right. So is it worth doing the revert here before #2337515: Allow @FieldType to customize views data is in, or should this be mark as postponed?

bojanz’s picture

It's pretty obvious that #2337515: Allow @FieldType to customize views data won't land in time for our beta (or won't land in the right branch, it might be 8.3.x material)

That means we have two options here:
1) Try to add the views data for our fields in some other way (working around the problem)
2) Do nothing and continue with the current approach

I would like to at least look into #1 in the near future.

bojanz’s picture

Status: Active » Closed (won't fix)

I tried. Core still isn't ready, it just doesn't work. Now that we're in beta, this ship has sailed.

googletorp’s picture

+1, We'll do it for Drupal 9. (I did this on a project and can say that the hazzle is just not worth it).