Leading zeros in Private Comments are ignored when saving the field

TalkBug Collectors

Join LibraryThing to post.

Leading zeros in Private Comments are ignored when saving the field

1bnielsen
Oct 18, 2025, 5:49 pm

This was noticed here first: https://www.librarything.com/topic/374733 by @KJAdkins
The idea was to use leading zeros to make sorting Private Comments behave like a numerical sort.

To replicate the bug, take any book with an empty Private Comments field.

Private Comments: empty gives Private Comment = ""
Private Comments: 641 gives Private Comment = "641"
Private Comments: 00641 gives Private Comment = "641"
# The line above shows the bug as expected and intended behaviour would be Private Comment = "00641"
Private Comments: A00641 gives Private Comment = "A00641"
Private Comments: 00641 gives Private Comment = "00641"

And the reverse also displays the bug:

Private Comments: empty gives Private Comment = ""
Private Comments: 00641 gives Private Comment = "00641"
Private Comments: 641 gives Private Comment = "00641"
Private Comments: A00641 gives Private Comment = "A00641"
Private Comments: 641 gives Private Comment = "641"

I.e. it doesn't delete leading zeros, it just ignores them when saving the contents of the field.

2knerd.knitter
Oct 20, 2025, 8:38 am

This should be fixed.