/templates/subjects/fiction throws error
Problem
https://openlibrary.org/subjects/fiction throws the following error:
/openlibrary/openlibrary/templates/subjects.html: error in processing template: TypeError: %d format: a real number is required, not NoneType (falling back to default template) Unable to render this page.
Reproducing the bug
- Go to ...https://openlibrary.org/subjects/fiction
- Do ... see error.
- Expected behavior: page should load
- Actual behavior: error
Context
- Browser (Chrome, Safari, Firefox, etc):
- OS (Windows, Mac, etc):
- Logged in (Y/N):
- Environment (prod, dev, local): prod
Breakdown
Implementation Details (for maintainers)
Requirements Checklist
- [ ]
Related files
Stakeholders
Instructions for Contributors
- Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Thank you! This is a duplicate of #13192
Context
Verified against current code (65e0fc9) that the duplicate determination above is technically accurate — this is the same crash, not just a superficially similar report:
openlibrary/templates/subjects.html#L31—$ungettext("%(count)d work", "%(count)d works", page.work_count, count=page.work_count)crashes on%(count)dwhenpage.work_countisNone.openlibrary/plugins/worksearch/subjects.py#L286—work_count=result.num_foundpasses through with noNoneguard.openlibrary/plugins/worksearch/code.py#L573-L575—SearchResponse.from_solr_result()setsnum_found=None+error=...as a paired sentinel whenever the underlying Solr query errors or returns nothing; nothing downstream checks.errorbefore formatting.
Issue Assessment
No further action needed here — this issue is closed and correctly superseded by #13192, which already carries Priority: 1 and Lead: @cdrini. Tracking should continue there.
Full triage checklist
- [ ] Triage — labels (
Needs: Triage,Needs: Lead,Needs: Breakdown) are stale relative to the issue's actual disposition (closed as duplicate), left unchanged since relabeling a closed duplicate has no routing value - [x] Problem / opportunity — specific error and URL given, unambiguous
- [x] Scope — single, well-scoped bug report
- [ ] Justification — impact not explicitly stated by reporter (implicitly high: page-breaking crash)
- [ ] Success & testing criteria — not defined by reporter
- [ ] Proposal & breakdown — breakdown section left as unfilled template placeholders
- [ ] If bug: environment & repro steps — repro steps given, but browser/OS/logged-in fields left blank
- [ ] Risks, concerns, open questions — none surfaced by reporter
- [x] Richy context — code reviewed, duplicate confirmed accurate against current source
- [ ] References — no screenshots/designs provided
[!NOTE] This comment was automatically generated by Richy, Open Library's issue enrichment assistant, on behalf of @mekarpeles. This is NOT a sign-off. This issue needs lead review before work begins.