FieldItemBase defines "value" as the default main property name for a field item. AddressItem field types do not seem to have a "value" property defined, and this causes errors in other areas of Drupal. Namely, when other modules such as Rules are attempting to determine the type of data of this field, they are unable to figure it out because "value" doesn't have a valid data type for address fields.

I'd like to submit a patch for this, however I'm not entirely sure what the correct mainPropertyName should be for an address field. Any insight into this?

Comments

bmcclure created an issue. See original summary.

replicaobscura’s picture

This is the cause of https://www.drupal.org/node/2694685 so I've referenced this issue there.

replicaobscura’s picture

replicaobscura’s picture

replicaobscura’s picture

Attached is a patch which sets the mainPropertyName to NULL, which is what the method recommends when there is no "main" property name.

replicaobscura’s picture

Status: Active » Needs review
replicaobscura’s picture

Issue summary: View changes

  • bojanz committed be940c9 on 8.x-1.x authored by bmcclure
    Issue #2823536 by bmcclure: AddressItem should override FieldItemBase::...
bojanz’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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