Blogs Engineering

A Singular Route Helper Fixes Hitobito's Invoice Quick Search

Englischer Artikel. Clicking an invoice suggestion in Hitobito's global search led to a 404. The fix swaps one route helper for the right one.

Rubyhitobito/hitobitoRailsroutingsearch

A one-word Rails fix for a 404 in global search.

Kurze Antwort

In Hitobito's global search, pressing Enter on an invoice number worked, but clicking the invoice suggestion in the popup returned a 404. The suggestion URL was built from the wrong route helper. The fix uses invoice_path instead of invoices_path. It was merged as PR #4436 and closed issue #4399.

The problem

Hitobito is an open-source Rails application for managing organizations and their members. Issue #4399, reported on version 2.10.3, described the 404 when clicking an invoice suggestion in global search.

Root cause

According to the PR, the quick search partial built its invoice base URL from the JSON:API invoices_path helper instead of the top-level invoice_path helper, so the generated suggestion link didn't resolve.

The fix

                                event_url: event_path(1).gsub(/\/1$/, ''),
-                               invoice_url: invoices_path(1).gsub(/\/1$/, '') }
+                               invoice_url: invoice_path(1).gsub(/\/1$/, '') }

By the numbers

  • Repository: hitobito/hitobito, 485 stars (Nov 3, 2026), Ruby, AGPL-3.0
  • Files changed: 1
  • Lines: +2 / -2 (including a copyright year update)
  • Commits: 2 (1 from the PR author, 1 from a maintainer)
  • Opened: Aug 21, 2026. Merged: Sep 14, 2026. Time to merge: 23 days, 15 hours
  • Review: approved and merged by a maintainer

How the review went

A maintainer added a commit adjusting the changelog, noting the entry was "Not needed due to this being a bugfix, not a feature". They then approved and merged the PR, so the final diff touches only the quick search template.

FAQ

Did the PR include the claimed view spec and changelog note?

The description claimed both, but no view spec is present in the merged diff. The original commit deleted a changelog line; the maintainer corrected the changelog before merging.

Where can I read more?

See the pull request and the original issue.

Das Ziel

Some bugs are one word long. Finding the word is the work.

Loop ausführen

Verwandle Produktionssignale in geprüfte Fixes.

Starte eine kostenlose Testversion und sieh, wie Prilog reale Incidents mit Pull Requests auf Code-Ebene verbindet.