Islandora / controlled_access_terms

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

Validate date intervals - start date must be before end date #124

Open AronNovak opened 3 weeks ago

AronNovak commented 3 weeks ago

GitHub Issue:

123

What does this Pull Request do?

Adds stricter validation for date ranges, start date should be earlier than end date.

What's new?

It validates date intervals for EDTF fields, so previously accepted (but incorrect) date entries could become suddenly not accepted by this change.

Interested parties

@Islandora/committers

seth-shaw-asu commented 2 weeks ago

Tests are failing because the item you added is processed with the "intervals" parameter of validate() set to FALSE.

See https://github.com/Islandora/controlled_access_terms/blob/2.x/src/EDTFUtils.php#L132 and https://github.com/Islandora/controlled_access_terms/blob/2.x/tests/src/Kernel/EdtfUtilsTest.php#L59.