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

Allow multiple Media Use selections on file media #1142

Closed
ajstanley opened this issue Jun 4, 2019 · 10 comments
Closed

Allow multiple Media Use selections on file media #1142

ajstanley opened this issue Jun 4, 2019 · 10 comments

Comments

@ajstanley
Copy link
Contributor

No description provided.

@ajstanley
Copy link
Contributor Author

I've got a working OCR module now to hook up to the Hypercube microservice. I want all the image stuff that takes place with an original file, but also want to mark the input as an OCR candidate. If we switch Media Use to allow multiples from a radio select we can pick and choose what sorts of behaviors we want for any given file object.

@seth-shaw-unlv
Copy link
Contributor

I like this idea. Even though for images we may want a distinct "Original File" and "Service File" (primary access version) there are instances where we want to use an "Original File" as the access copy (e.g. a PDF original that works fine for access). Juggling the display modes between the two can be problematic, but if we simply allow a Media to be both an "Original File" AND a "Service File" I won't have to worry about incorporating "Original File" fall-backs in the absence of a "Service File."

Currently, you can configure your Islandora site to do this before any Media are created. But I think this is a sensible default.

@dannylamb
Copy link
Contributor

dannylamb commented Jun 4, 2019

As far as the code is concerned, there may be a handful of spots where I'm making the assumption that you have one media_use. Like i'm just pulling the first instead of iterating over the list of one.

We also could consider amending the REST API to account for this. Right now, when you PUT a media to a node, you have to provide a media_use term id as a route param. We could let that be multiple with Drupal's + syntax, though that may be a views only thing.

Either way, I think the fallout from a change like this is pretty minor, and it makes sense that a file may serve two purposes.

@seth-shaw-unlv
Copy link
Contributor

I tested this out. Simply changing islandora/modules/islandora_core_feature/config/install/field.storage.media.field_media_use.yml's cardinality from '1' to '-1' works beautifully.

After adjusting the cardinality I created an image repository item and only selected 'Original File' for the media_use and derivatives still worked as expected. Then I added another image and selected both 'Original File' and 'Service File'. This time only the thumbnail was generated as one would expect. All the views and display modes are working as I would expect.

I'm in favor of this being the new default.

@dannylamb
Copy link
Contributor

Can haz PR?

@seth-shaw-unlv
Copy link
Contributor

@dannylamb, sure. Just let me test the change on a site with existing content to see if we need an update hook for this.

@seth-shaw-unlv
Copy link
Contributor

Sweet, it worked without any update hook shenanigan!.

@seth-shaw-unlv
Copy link
Contributor

Yes, you can!

@dannylamb
Copy link
Contributor

As soon as my next environment spins up, I'll test this.

@mjordan
Copy link
Contributor

mjordan commented Jun 26, 2019

PRs merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants