Skip to content

🐛 Point the range facet's distribution link at the catalog - #3386

Merged
kirkkwang merged 1 commit into
mainfrom
homepage-range-limit-link
Oct 9, 2026
Merged

kirkkwang merged 1 commit into
mainfrom
homepage-range-limit-link

Conversation

@kirkkwang

Copy link
Copy Markdown
Collaborator

refs notch8/palni_palci_knapsack#797

Point the range facet's distribution link at the catalog

When a range facet (range: true) has values, the homepage themes that render facets (heritage, cultural_repository) raise a 500:

ActionView::Template::Error (No route matches {:action=>"range_limit", :controller=>"hyrax/homepage",
  :range_field=>"date_range_isim", :range_start=>"194", :range_end=>"9116", ...})
app/views/themes/heritage/hyrax/homepage/_browse_facets.html.erb:10

BlacklightRangeLimit::RangeFacetComponent#range_limit_url calls main_app.url_for(action: 'range_limit') without a controller, so Rails fills in the current one. Hyrax::HomepageController inherits the range_limit action from CatalogController, but routes go by controller name, not class hierarchy, and range_limit is only routed for catalog. The facet "more" link has the same problem, which HomepageController#search_facet_path already works around. That override can't reach this link because the component builds the URL itself rather than going through a controller helper, so this decorates the component.

Stock Hyku configures no range facet, so it only shows up once a knapsack adds one. It hit PALS production (au-archives.hykucommons.org) after a reindex filled in its date range field. This is the same decorator the PALS knapsack is shipping as a hotfix.

Still present in blacklight_range_limit 9.3.0 / main, so a gem bump won't fix it.

Changes proposed in this pull request:

  • Decorate BlacklightRangeLimit::RangeFacetComponent#range_limit_url to pass controller: '/catalog'
  • Add a spec that reproduces the error from a homepage request and checks the link resolves to /catalog/range_limit

@samvera/hyku-code-reviewers

blacklight_range_limit builds the "view distribution" link with no
controller, so on homepage themes that render facets (heritage,
cultural_repository) it resolves to hyrax/homepage#range_limit. That
has no route, and the homepage 500s once a range facet has values.

Assisted by: Claude Opus 5.5
@kirkkwang kirkkwang added the patch-ver for release notes label Oct 9, 2026
@kirkkwang
kirkkwang marked this pull request as ready for review October 9, 2026 15:50
@kirkkwang
kirkkwang enabled auto-merge October 9, 2026 15:53
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Test Results

    3 files  ±0      3 suites  ±0   24m 24s ⏱️ - 1m 0s
3 996 tests +2  3 937 ✅ +2  59 💤 ±0  0 ❌ ±0 
4 023 runs  +2  3 962 ✅ +2  61 💤 ±0  0 ❌ ±0 

Results for commit 6bdfdee. ± Comparison against base commit 41b9868.

This pull request removes 42 and adds 44 tests. Note that renamed tests count towards both.
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to destroy d96d9af5-522a-48a8-9c2d-3b4790c533e0
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to edit f910b1ca-1c8a-42f9-8fdd-1a49cc770b22
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to read b0037855-108c-4020-8013-87457bd486e3
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to update fb851864-425c-43d3-86c3-464ad409dd5e
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to destroy 9b4b9525-33cf-4c82-9896-9891cedf85e7
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to edit 838d1c94-f3ba-48d0-b173-b142ae0528d9
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to read 51e09a0a-981f-489a-9c52-54e2291e0e99
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to update e19da692-dd68-489b-abd2-d3cd1e4d430a
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor GenericWork permissions is expected not to be able to destroy ab236dc4-8993-483f-9ace-1b20cc87c5a6
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor GenericWork permissions is expected not to be able to edit c5cfd2af-f20d-440b-8d49-95f66baa5e0b
…
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to destroy 4245328e-dd14-4073-93de-a3c019d70bac
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to edit 4a6dcb9f-f00e-4512-b022-26430b4c4a17
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to read 613639a8-83be-46d7-bf1b-25e289dc4a53
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor Etd permissions is expected not to be able to update 237fb904-83f4-4782-8f1e-60612f706990
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to destroy 49ae599a-3c10-4465-ab17-17dece80e534
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to edit feb45e33-6c65-4a40-837d-0584a9f027f1
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to read 85a3428f-f5d2-4085-a717-090cea1bbe1c
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor FileSet permissions is expected not to be able to update b6f1764d-25b9-4d9a-900e-c2cbc0d7c568
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor GenericWork permissions is expected not to be able to destroy 0a60dd7d-9faa-4cc9-a5ff-db2d3e683a35
spec.abilities.work_ability_spec ‑ Hyrax::Ability::WorkAbility when work depositor GenericWork permissions is expected not to be able to edit 50ae64b5-423e-4bc6-9ca8-e52c6ceaf3ad
…

@kirkkwang
kirkkwang merged commit 3f1662d into main Oct 9, 2026
20 checks passed
@kirkkwang
kirkkwang deleted the homepage-range-limit-link branch October 9, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch-ver for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants