From 71c7e4b3fff5530b3c2111cb9a7daecb676a38b7 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 Content-Type: text/plain; charset=utf-8 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 --- Koha/Objects.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Objects.pm b/Koha/Objects.pm index 1a52188..41fee35 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.1.4