Closed rosiel closed 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?
Threw together https://github.com/Islandora/controlled_access_terms/pull/96 as a theoretical fix.
What steps does it take to reproduce the issue?
Enable date sets in an EDTF field (admittedly, this is "not recommended")
Enable multiple values in that field
Add multiple date sets to see how they render.
When does this issue occur? When looking at the node
Which page does it occur on? a node
What happens? the human-readable version of each date set includes data from other "deltas" (i.e. other values in the multivalued field)
In my example the first two values in the multivalued field are:
[1667,1668,1670..1672] which renders as "one of the dates: 1667, 1668, 1670 until 1672"
[..1760-12-03] which renders as "one of the dates: 1667, 1668, 1670 until 1672, 1760-12-03 or some earlier date"
To whom does it occur (anonymous visitor, editor, administrator)? Everyone can see it.
What did you expect to happen? the values to be rendered to text independently
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: