Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🐛 Inactive terms are appearing in local controlled vocab dropdowns #2746

@ShanaLMoore

Description

@ShanaLMoore

Summary

When a local controlled vocabulary term, such as a license, is marked as inactive in its local authority file (e.g., config/authorities/licenses.yml), it is no longer hidden from the dropdown menu on the work deposit form. Previously, inactive terms were correctly hidden for new works but would still appear on the show page and edit form for existing records that used them. The current bug is that inactive terms are appearing in the dropdown for all works, new and old. This issue is occurring when the HYRAX_FLEXIBLE flag is set to false and appears to be a regression introduced by recent changes to support flexible metadata controlled vocabulary.

Acceptance Criteria

  • When a controlled vocabulary term is marked as active: false in its local authority file, it does not appear in the dropdown menu on the new work deposit form.
  • When editing a work that has an inactive term saved, the inactive term remains selected in the dropdown menu.
  • When viewing a work that has an inactive term saved, the term is displayed on the work's show page (if configured that way).
  • This functionality works correctly when HYRAX_FLEXIBLE=false and HYRAX_FLEXIBLE=true.

Screenshots or Video

BEFORE

NOTE: This is an example of License. This issue is NOT a license only issue. It could impact anything in config/authorities that have active: keys.

Image

AFTER

Image

Testing Instructions

Locally:

  1. Ensure your environment is running with HYRAX_FLEXIBLE=false.
  2. Modify config/authorities/licenses.yml and set active: false for a license, for example, "Creative Commons BY Attribution 4.0 International".
  3. Reload the application server.
  4. Navigate to the new work deposit form. The inactive license should not appear in the license dropdown.
  5. Now, find an existing work that uses the license you just inactivated (you may need to create one before inactivating the term).
  6. Navigate to the show page for that work. The inactive license should still be displayed.
  7. Click "Edit" on the work. The license field should still have the inactive license selected.

repeat test for HYRAX_FLEXIBLE=true. See notes below.

Sample Files

N/A

Notes

For questions about how this functionality worked before the regression, please consult Nic Don.

This should work for HYRAX_FLEXIBLE=true as well, if using local vocab. When HYRAX_FLEXIBLE=true, you must update the metadata profile to configure local vocabulary use. See https://github.com/samvera/hyku/blob/main/config/metadata_profiles/m3_profile.yaml#L809-L810 as an example. There's also documentation in hyku: https://github.com/samvera/hyku/blob/main/docs/controlled-vocabularies.md

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions