diff --git a/C4/ClassSortRoutine/Dewey.pm b/C4/ClassSortRoutine/Dewey.pm index b4ba92199e..62a68b91ce 100644 --- a/C4/ClassSortRoutine/Dewey.pm +++ b/C4/ClassSortRoutine/Dewey.pm @@ -76,6 +76,10 @@ sub get_class_sort_key { } } } + # Pad the first digit_group if there was only one + if (1 == $digit_group_count) { + $tokens[0] .= '_000000000000000' + } my $key = join("_", @tokens); $key =~ s/[^\p{IsAlnum}_]//g; diff --git a/C4/Search.pm b/C4/Search.pm index b698a93aab..21c61fba1d 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -364,10 +364,10 @@ sub getRecords { $sort_by .= "1=9003 >i "; } elsif ( $sort eq "call_number_asc" ) { - $sort_by .= "1=20