samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
182 stars 122 forks source link

Allow new applications to alter AdminSetCreateService::DEFAULT_ID while maintaing backwards compatibility #6773

Open bwatson78 opened 2 months ago

bwatson78 commented 2 months ago

Descriptive summary

Allow new applications to alter AdminSetCreateService::DEFAULT_ID while maintaing backwards compatibility

Actual behavior (include screenshots if available)

Hyrax v5.0.1 has hardcoded the default admin set id as admin_set/default, which creates an incompatibility with Fedora adapter users instituting Fedora v6.5. Despite the Fedora community's attempt to allow / (forward slashes) by setting an option to do so, enabling that option doesn't fix errors that occur when attempting to save an object with the default admin set id.

Acceptance Criteria/Expected Behavior

Allow Hyrax implementers to set DEFAULT_ID to their desired value and ensure backwards compatibility by updating the default admin set's id if an instance of the AdminSet with the old id is found. This way, an instance of Hyrax knows of the old default and can replace it when Hyrax is upgraded.

dlpierce commented 2 months ago

I don't see a problem with moving away from using the Hyrax::AdminSetCreateService::DEFAULT_ID constant and having it always be set by the Hyrax config.

Somewhat related to this, I wonder if the complexity of this service could be reduced by using string for the valkyrie id field. I think that would allow a string like admin_set_default to be a valid id.