Skip to content

Conversation

@moseshll
Copy link
Contributor

@moseshll moseshll commented Jan 15, 2026

  • Ticket synopsis: catalog.hathitrust.org/Record/foo has a Smarty "undefined index" error buried in a data-record-count attribute.
  • The various interface/ templates that refer to this variable treat it inconsistently.
    • Giving recordCount a |default:0 silences the error
    • One template has |default:"0": confusing and unnecessary since it's for an HTML attribute - changed to just 0
    • recordCount appears not be used anywhere in the Record hierarchy of templates/PHP code, do we even need data-record-count in the Record error template? If not then the best approach is probably to remove it. It may be copy-pasta from the Search side.

- The various `interface/` templates that refer to this variable treat it inconsistently.
  - Giving `recordCount` a `|default:0` silences the error
  - Some templates gave it a `|default:"0"` which is confusing and unnecessary since it's for an HTML attribute - changed to just `0`
  - `recordCount` appears not be used anywhere in the `Record` hierarchy of templates/PHP code, do we even need `data-record-count` in the Record error template?
@moseshll moseshll requested a review from carylwyatt January 15, 2026 16:26
Copy link
Member

@aelkiss aelkiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I think the question of whether we could omit data-record-count entirely is for @carylwyatt.

Copy link
Member

@carylwyatt carylwyatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing in firebird that references data-record-count or handles a custom data attribute via the document.body.dataset property (searched for dataset.recordCount). I double-checked the catalog for that type of handling and couldn't find anything here, either. Nothing in babel uses data-record-count either. Custom data attributes like that are usually there to be manipulated by javascript for some purpose, and I thought perhaps it was a clicklogger thing, but I can't find any reference to it outside of catalog. Very weird!

Feel free to delete it, I highly doubt it's doing anything.

…n `interface/themes/firebird/Record`

 - Leaving it alone in `interface/themes/firebird/Search` -- it may not be used there either but seems more relevant
@moseshll moseshll merged commit 3907ce7 into main Jan 15, 2026
2 checks passed
@moseshll moseshll deleted the ETT-1245_undef_recordCount branch January 15, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants