Leading zeros in Private Comments are ignored when saving the field
Talk Bug Collectors
Join LibraryThing to post.
1bnielsen
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.
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.

