Closed mark-dce closed 8 months ago
BUG Items with issues numbers with leading zeroes are being indexed as octal numbers instead of decimal: e.g. "060" --> 48 (base 8, octal) indtead of "060" --> 60 (base 10)
DIAGNOSIS Rails interprets a leading 0 in numeric literals as an octal number. See: https://docs.ruby-lang.org/en/2.0.0/syntax/literals_rdoc.html#label-Numbers
FIX Add a test and refactor the code to ensure we cast issue and volume strings to base-10 decimal integers.
BEFORE (id, issue_number_ssi[string], issue_number_isi[numeric])
AFTER
BUG Items with issues numbers with leading zeroes are being indexed as octal numbers instead of decimal: e.g. "060" --> 48 (base 8, octal) indtead of "060" --> 60 (base 10)
DIAGNOSIS Rails interprets a leading 0 in numeric literals as an octal number. See: https://docs.ruby-lang.org/en/2.0.0/syntax/literals_rdoc.html#label-Numbers
FIX Add a test and refactor the code to ensure we cast issue and volume strings to base-10 decimal integers.
BEFORE (id, issue_number_ssi[string], issue_number_isi[numeric])
AFTER