🐛 [i2925] - Fix flexible form to use resource contexts for schema field inclusion#7347
Merged
ShanaLMoore merged 5 commits intomainfrom Feb 12, 2026
Merged
🐛 [i2925] - Fix flexible form to use resource contexts for schema field inclusion#7347ShanaLMoore merged 5 commits intomainfrom
ShanaLMoore merged 5 commits intomainfrom
Conversation
Pass resource.contexts (plural) into form_definitions_for so context-specific metadata profile properties (e.g. dimensions for special_context) appear on the work form when the admin set has that context assigned.
Test Results 13 files ± 0 13 suites ±0 2h 51m 20s ⏱️ - 1m 49s Results for commit 28e5a75. ± Comparison against base commit 56a94e3. This pull request removes 358 and adds 362 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
kirkkwang
approved these changes
Feb 12, 2026
Contributor
kirkkwang
left a comment
There was a problem hiding this comment.
Nice fix, glad it was just a typo
ShanaLMoore
added a commit
to samvera/hyku
that referenced
this pull request
Feb 12, 2026
Issue: - #2925 PR: - samvera/hyrax#7347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Summary
Bug: With HYRAX_FLEXIBLE=true, context-specific properties from the metadata profile (e.g. “dimensions” for special_context) do not appear on the work form even when the work’s admin set has that context assigned.
Cause: In Hyrax::Forms::ResourceForm#initialize, the form uses r.context (singular) to pass to form_definitions_for; the resource only has r.contexts (plural), so contexts is always nil and M3SchemaLoader omits all context-restricted properties.
PS. 5.0-flexible has it as a plural reference as well
Changes proposed in this pull request:
Fix: In resource_form.rb, use the resource’s contexts (plural) when calling form_definitions_for (e.g. context = r.respond_to?(:contexts) ? r.contexts : nil and pass it as contexts: context), so the form includes properties for the work’s context(s), e.g. “dimensions” for admin sets with “special context.”
@samvera/hyrax-code-reviewers
metadata-profile-v.7 (1).yml
BEFORE
dimensions was missing from an ImageResource work created from the 'special context' admin set
AFTER