Multiple value Address field in views always shows first item subdivision name

Created on 12 November 2020, about 4 years ago
Updated 21 July 2023, over 1 year ago

When "Display the subdivision name instead of the subdivision code" is enabled for multi-value address field, views renders first item value for all items.

I believe the problem is in line 91 of src/Plugin/views/field/Subdivision.php

$address = $entity->{$this->definition['field_name']}->first();

I guess we need something like this
$address = $entity->{$this->definition['field_name']}->get($index);

but have no idea how to get the $index value.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡¦Bosnia and Herzegovina nno

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024