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

Derivative actions can be created for Media Use terms with no URI #1537

Open
qadan opened this issue Jun 4, 2020 · 4 comments
Open

Derivative actions can be created for Media Use terms with no URI #1537

qadan opened this issue Jun 4, 2020 · 4 comments
Labels
Type: enhancement Identifies work on an enhancement to the Islandora codebase

Comments

@qadan
Copy link

qadan commented Jun 4, 2020

I actually am not 100% sure what direction to go in with this, but here's the case:

  • Create a Media Use term with no URI (since it's not a required field)
  • Create a new, let's say 'Generate an image derivative' action
  • In that new action, fill in either the Source Term or Derivative Term fields with the new Media Use
  • Save the new action
  • Edit the action; you'll see the Source Term or Derivative Term fields are empty

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

@qadan
Copy link
Author

qadan commented Jun 4, 2020

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?

@seth-shaw-unlv
Copy link
Contributor

@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.

@ajstanley
Copy link
Contributor

ajstanley commented Jun 4, 2020 via email

@qadan
Copy link
Author

qadan commented Jun 5, 2020

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

@kstapelfeldt kstapelfeldt added Type: enhancement Identifies work on an enhancement to the Islandora codebase and removed architecture labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement Identifies work on an enhancement to the Islandora codebase
Projects
Development

No branches or pull requests

4 participants