Open qadan opened 4 years ago
This actually brings up another issue; since actions aren't using uniquely identifiable properties for the terms, you're not actually guaranteed to get the correct term back. There's nothing enforcing unique URIs either; not sure this is a use case that would ever exist, but I dunno, would it not be more correct to store the term's ID in the action?
@qadan, we use the URIs because they allow us to share the configs across repositories. We can't rely on a term having the same tid across Drupal instances, but we can rely on the URI since we define them with the term migration.
I've set up a set of actions that extend directly from EmitEvent instead of AbstractGenerateDerivative, that don't use Media Use tags at all. I select Entity Bundle and Media Source File Mimetype in the Context selection instead. For the use cases I was using at the time I found it to be more dependable since it doesn't require the user to enter the right tag on ingest.
On Thu, Jun 4, 2020 at 2:26 PM Seth Shaw notifications@github.com wrote:
@qadan https://github.com/qadan, we use the URIs because they allow us to share the configs across repositories. We can't rely on a term having the same tid across Drupal instances, but we can rely on the URI since we define them with the term migration.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Islandora/documentation/issues/1537#issuecomment-638995555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADY2J3YNIDKNF3L5YXI4MLRU7KNVANCNFSM4NSWVJFA .
-- Alan Stanley Developer and Training Specialist Agile Humanities
So I guess the point then perhaps is that if those URIs are intended to be unique to terms, this isn't really enforced in any way or communicated through UI (i.e., with a 'required' field or with validation)? Currently the forms seem volatile, or at least don't communicate their intentions, or if things go south
I actually am not 100% sure what direction to go in with this, but here's the case:
Reason it happens is simple enough; the form submit handler attempts an IslandoraUtils::getUriForTerm(), which just tosses back NULL with no complaint, and the submit handler accepts this and pops it back into the config.
Like I say, not 100% on the best way to handle this. Would be simplest to handle this in the validation handler for the form, but then you're placing a requirement on Media Use terms that Media Use terms themselves don't have. Could make the URI required in Media Use terms, but I expect that's not the case for a reason? Possibly to not strictly tie Media Use to PCDM? It also may be worth using the
nullable
property in stuff like the different action config schemata to ensure strict conformance