Skip to content

Update EDTFYear.php to handle multi valued fields#149

Merged
seth-shaw-asu merged 1 commit intoIslandora:2.xfrom
joshdentremont:patch-1
Aug 28, 2025
Merged

Update EDTFYear.php to handle multi valued fields#149
seth-shaw-asu merged 1 commit intoIslandora:2.xfrom
joshdentremont:patch-1

Conversation

@joshdentremont
Copy link
Contributor

@joshdentremont joshdentremont commented Aug 19, 2025

What does this Pull Request do?

Before this the EDTF Year processor would only grab years from the first value of a multi valued field. This updates it to get years from each value.

How should this be tested?

Check the years that are being indexed from multi valued fields before and after these changes. I tested on normal fields, and you can see the before and after here:
image
image

It should also be tested on paragraphs. This updates it to handle multiple paragraphs as well, but I'm not familiar with paragraphs so it would be good to get some expert feedback on that aspect.

Interested parties

@Islandora/committers

$paragraph_field_config = reset($paragraph_ids);
$paragraph_field_config_array = explode('.', $paragraph_field_config);
$paragraph_field_name = end($paragraph_field_config_array);
$paragraph_entity = $entity->get($paragraph_field_name)
Copy link
Member

@joecorall joecorall Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to keep this in case $entity references a deleted paragraph

@seth-shaw-asu seth-shaw-asu self-assigned this Aug 27, 2025
Copy link
Member

@seth-shaw-asu seth-shaw-asu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised. 👍

@seth-shaw-asu seth-shaw-asu merged commit 737e89a into Islandora:2.x Aug 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants