Bug 18635: Koha::Patron->guarantees() should return results alphabetically

To test:
1 - Add the same guarantor to a number of patrons, ensuring random order
alphabetically
2 - View the guarantors record, note unordered list of guarantees
3 - Apply patch
4 - Guarantees are alphabetical

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fe6cb85c55)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 74a2565c99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2017-05-18 21:08:22 -04:00 committed by Fridolin Somers
parent 3f24a07a7e
commit 784b7d7af2
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ Returns the guarantees (list of Koha::Patron) of this patron
sub guarantees {
my ( $self ) = @_;
return Koha::Patrons->search( { guarantorid => $self->borrowernumber } );
return Koha::Patrons->search( { guarantorid => $self->borrowernumber }, { order_by => { -asc => ['surname','firstname'] } } );
}
=head3 housebound_profile