-
Notifications
You must be signed in to change notification settings - Fork 27
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
more forgiving call for label from QaSelectService #1047
Conversation
returns nil instead of throwing exception
I think we intended this to be an error. There's a problem in the data that drives the interface. Returning nil is not going to be an acceptable resolution. |
I recognize that the data we've put in the rights field doesn't jive with the LicenseService. Is our better workaround to override the sufia_helper? Would a contribution to that codebase to make more sense?
|
@pgwillia can you show the data you have in the yaml file you are loading? I would expect it to have |
@jcoyne here's the yaml file for licenses: https://github.com/ualbertalib/Hydranorth2/blob/master/config/authorities/licenses.yml Problem is that we allowed free text in our licence field. Then we can have rights like: We need this so that we can maintain the rights agreements that our users selected when they first deposited to our IR (pre Hydra). |
@pgwillia There are some ways to break this apart:
CurationConcerns.config.default_license_service_class = MyCustomLicenseService |
I'm going to close this PR based on @jcoyne's response that returning nil is not acceptable. @jeremyf I do have a workaround in place for our stakeholders to try-out Sufia 7 which involved opening gems and modifying in place. In Sufia::SufiaHelperBehavior I am currently catching the KeyError and returning the rights value without using the LincenseService. Editing gems in place cannot be a permanent solution a) because it would make our automated deployment to production environments complicated and b) hard to maintain. The second idea does interest me. Being able to configure LicenseService would mean I wouldn't have to override Sufia::SufiaHelperBehavior#license_links. I'd still have to do some work to implement MyCustomLicenseService but that might make more sense. Thanks for your input. I appreciate it! |
@pgwillia I submitted a PR to codify the expectations via a spec. |
@pgwillia The pattern for configuration is similar to what is found in CurationConcerns::Configuration. If you are interested, I can work on a patch later this week. I believe your particular use case may be something that others may be interested in. |
@jeremyf that would be great! I took a quick look at CurationConcerns::Configuration and don't completely grok it. I'd learn a lot by helping you work on the patch. Let me know what I can do. |
more forgiving call for label from QaSelectService returns nil instead of throwing exception
What I did: Migrated (customized) metadata from Hydranorth application based on Sufia 6.2 to Sufia 7.2 application. All
catalog
calls failed in the new application.Discovered that
fetch
will throw the KeyError exception while the[]
syntax will return nil and carry on when the key value is not present.@projecthydra/sufia-code-reviewers