Omeka
Omeka copied to clipboard
Share validators between Records and forms
Zend_Form has nice ways of showing validation errors on a per-field basis, so we use that pretty often.
At the same time, we need to keep the validators that run within a record to keep developers from manually saving invalid records.
It would be nice, and should be possible, to define validators within the Record in such a way that it's easy to bulk-apply them to an Omeka_Form instance so we don't have to specify a bunch of validators twice where we have a form that lets you set basically every piece of data for a record.
Would be great to share the error messages for each validator too.
@clioweb That would be #47, I believe.
@clioweb That would be #47, I believe.
That seems to just cover duplicate messages among different forms. I meant sharing messages between the form and the record.
Ah.
I think this would involve instantiating the validator classes in just one place. That would mean the messages would only be defined once, too.