From 4bd8b751e396eca594606b988de1fa5dbf3fd73f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 31 Mar 2017 09:32:53 +0200 Subject: [PATCH] Bug 18332: [QA Follow-up] Adjust slice call in last method We should call slice in list context with the correct indexes. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- Koha/Objects.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Objects.pm b/Koha/Objects.pm index 1a52188d76..41fee3507e 100644 --- a/Koha/Objects.pm +++ b/Koha/Objects.pm @@ -220,7 +220,7 @@ sub last { my $count = $self->_resultset->count; return unless $count; - my $result = $self->_resultset->slice($count - 1, $count)->first; + my ( $result ) = $self->_resultset->slice($count - 1, $count - 1); my $object = $self->object_class()->_new_from_dbic( $result ); -- 2.39.5