From 254883608912456bc15f57cf282099b8641faf54 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 3 Oct 2017 17:03:54 -0300 Subject: [PATCH] Bug 19370: Remove undefined variable warning Signed-off-by: Tomas Cohen Arazi Signed-off-by: Lari Taskula Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- Koha/REST/Plugin/Query.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm index 32656a401b..45cfe14e7c 100644 --- a/Koha/REST/Plugin/Query.pm +++ b/Koha/REST/Plugin/Query.pm @@ -79,11 +79,12 @@ Generates the DBIC order_by attributes based on I<$params>, and merges into I<$a my ( $c, $args ) = @_; my $attributes = $args->{attributes}; - my @order_by = - map { _build_order_atom($_) } - split( /\|/, $args->{params}->{_order_by} ); + if ( defined $args->{params}->{_order_by} ) { + my @order_by = map { _build_order_atom($_) } + split( /\|/, $args->{params}->{_order_by} ); + $attributes->{order_by} = \@order_by; + } - $attributes->{order_by} = \@order_by; return $attributes; } ); -- 2.39.5