Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move EDTF validation to a constraint #1859

Open
jordandukart opened this issue Jun 24, 2021 · 2 comments
Open

Move EDTF validation to a constraint #1859

jordandukart opened this issue Jun 24, 2021 · 2 comments
Labels
Subject: Dates related to managing dates in Islandora. Consider also using the search and metadata tags. Type: documentation provides documentation or asks for documentation.

Comments

@jordandukart
Copy link
Member

Currently all the validation for the EDTF lives in the widget. While this works splendidly through the UI if another point of ingest is used (Workbench/REST/JSON:API etc) this validation will not get fired and can be inconsistent in the following scenario:

  • A user ingests an object outside of the UI with an EDTF Date
  • The EDTF is not valid with the configured validation upon edit
  • The object is no longer able to be updated as it has invalid data.

It appears this could be moved over to use a constraint. Core Drupal also utilizes these to provide field level validation.

@mjordan
Copy link
Contributor

mjordan commented Jun 30, 2021

Consensus at the 2021-06-30 tech call was that it would be good practice to use these contraints for any Islandora-specific custom field types. Also, some discussion that we should have a best practices guide for Islandora devs that would recommend using constraints.

@kstapelfeldt kstapelfeldt added bug Subject: Dates related to managing dates in Islandora. Consider also using the search and metadata tags. and removed bug labels Sep 25, 2021
@kstapelfeldt kstapelfeldt added the Type: documentation provides documentation or asks for documentation. label Feb 2, 2022
@adam-vessey
Copy link
Contributor

Braining a bit in this area recently, threw together Islandora/controlled_access_terms@2.x...adam-vessey:feature/edtf-constraints

However, struck with the issue: Moving to constraints would possibly include "promoting" few relevant bits of widget configuration to settings on the field (storage?), from where they are on the "widget", which potentially gets into writing update hooks to move 'em? Not the end of the world, but... given that they are then less-easily changed when there are values present on the storage side of things... unless... could possibly roll the config elsewhere? Or possibly roll some other mechanism to only allow "widening" conversions (so you can move to allow the use of sets/intervals, but not disable the capability to do so once enabled).

... or alternatively, ignore the set/interval settings, and just ensure that any content on the field looks like EDTF (to prevent arbitrary strings from migrations and whatnot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subject: Dates related to managing dates in Islandora. Consider also using the search and metadata tags. Type: documentation provides documentation or asks for documentation.
Projects
Development

No branches or pull requests

4 participants