From 5b0aaeb5aa667ebb4bd4fb4661b608ee3debea1c 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 --- 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 32656a4..45cfe14 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.7.4