Bug 20581: (follow-up) Passed value to status_alias
authorAndrew Isherwood <andrew.isherwood@ptfs-europe.com>
Thu, 7 Feb 2019 10:43:51 +0000 (10:43 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 22 Feb 2019 14:31:31 +0000 (14:31 +0000)
Now we have overloaded status_alias, we can no longer pass it undef (as
it uses that to determine if it's being used as a getter or setter). So
we now pass it -1 to indicate it should actually be setting undef (a
hack, I know, but what are you going to do...)

This patch makes sure ill-request.pl conforms to that. It also fixes the
testing of the passed parameter, which was wrong.

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

ill/ill-requests.pl

index acbdda2..d6be5c8 100755 (executable)
@@ -174,9 +174,9 @@ if ( $backends_available ) {
             $request->price_paid($params->{price_paid});
             $request->notesopac($params->{notesopac});
             $request->notesstaff($params->{notesstaff});
-            my $alias = ($params->{status_alias}) ?
+            my $alias = (length $params->{status_alias} > 0) ?
                 $params->{status_alias} :
-                undef;
+                "-1";
             $request->status_alias($alias);
             $request->store;
             my $backend_result = {