Ticket #1567 (closed enhancement: fixed)
Validation Hook called before validating item/checking required fields
| Reported by: | tmb@… | Owned by: | cjg |
|---|---|---|---|
| Priority: | Intend to | Milestone: | EPrints Wishlist |
| Component: | Default Config | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by cjg) (diff)
Need a validation hook which is called before any validation of an item takes place. If the hook returns false, the item will not be validated.
Example scenario: I've imported some records from the 70s, which don't have documents attached. I spot a typo in the metadata and try to fix it, but the validation rules for entering/editing items state that every item *must* have a document attached so I can't fix the typo unless I can find an electronic copy of the document (unlikely) or change the config (which I don't want to do because I want all new items deposited to require a document).
Desired solution: I define a validation hook which checks for a (hidden?) 'legacy' field. If this is set, I return false, and the item is not validated, otherwise I return true and the item is subject to the validation of the repository.
