Islandora / controlled_access_terms

Drupal module for subject and agents
GNU General Public License v2.0
7 stars 28 forks source link

[BUG] EDTF date sets in multivalued fields are rendered into human-readable text incorrectly. #95

Closed rosiel closed 1 year ago

rosiel commented 1 year ago

What steps does it take to reproduce the issue?

In my example the first two values in the multivalued field are:

Which version of Islandora are you using? 2 more meaningfully, the starter site

Any related open or closed issues to this bug report?

not that i know of

Screenshots:

Screenshot 2023-04-18 at 12 25 38 PM
adam-vessey commented 1 year ago

Giving a quick look, thinking that $formatted_dates just needs to be (re)initialized to an empty array before it is populated with the values of the new set: https://github.com/Islandora/controlled_access_terms/blob/7f33294c2074a3e079d114502176a3bd49e7afb7/src/Plugin/Field/FieldFormatter/EDTFFormatter.php#L161-L193

... probably something like adding a

$formatted_dates = [];

just before that foreach, kind of thing?

adam-vessey commented 1 year ago

Threw together https://github.com/Islandora/controlled_access_terms/pull/96 as a theoretical fix.