Fix redirects form crash on non-flexible installs#7436
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RedirectsFieldBehavior now loads the persisted redirects property from redirects.yaml, so the form has it in non-flexible mode. Update redirects.md and the field_behaviors.md exemplar to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Test Results 17 files ± 0 17 suites ±0 3h 29m 30s ⏱️ + 9m 34s Results for commit a7f1479. ± Comparison against base commit d4256c5. This pull request removes 435 and adds 439 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Contributor
|
Retested from Hyku with Flex true and false; this solution works now. |
ShanaLMoore
approved these changes
May 8, 2026
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.
Summary
NoMethodError.Details
The redirects feature adds a per-work alias list, exposed on the work edit form under an Aliases tab. Without this fix, opening that tab in a non-flexible install (
HYRAX_FLEXIBLE=false) crashes the page: the form partial readsf.object.redirects, but the form class never had theredirectsproperty registered.In flexible mode the m3 schema loader populates form properties from the metadata profile, so
redirectsis on the form and the partial works. In non-flexible mode that path doesn't run, and the existing redirects field behavior only registered the virtualredirects_attributes(used for nested form params) — never the persistedredirectsproperty the partial actually reads.The fix loads
redirectsonto the form fromconfig/metadata/redirects.yamlviaHyrax::FormFields(:redirects), the same mechanism every other YAML-backed form uses. Theredirects.yamlform options were also corrected fromprimary: false(no effect on form display gating) todisplay: false, matching how the loader actually decides what to render.Testing
HYRAX_REDIRECTS_ENABLED=trueandHYRAX_FLEXIBLE=false, edit any work, click the Aliases tab — the tab renders without error and shows the redirects table.HYRAX_FLEXIBLE=trueto confirm flexible mode still behaves correctly (no regression).HYRAX_REDIRECTS_ENABLED=false, edit a work — the Aliases tab is not present and the edit page renders normally.