[Bug 15165] REST API routes to list, edit and pay borrower's accountlines
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15165 --- Comment #47 from Lari Taskula <lari.taskula@jns.fi> --- (In reply to Josef Moravec from comment #43)
Test t/db_dependent/api/v1/accountlines.t fails:
Use of uninitialized value $amount in subtraction (-) at /home/vagrant/kohaclone/Koha/Account.pm line 178. Use of uninitialized value $amount in subtraction (-) at /home/vagrant/kohaclone/Koha/Account.pm line 205.
# Failed test at t/db_dependent/api/v1/accountlines.t line 178. # Looks like you failed 1 test of 37.
it's because the Koha::Account->pay always need an amount... so when api doesn't get an amount parameter, it can't have anything to pass - I think the API should return an error then
I took a look at this and provided a patch to fix it. Initially I wanted to enhance Koha::Account->pay to throw Koha::Exceptions in case of invalid input for amount (non-numeric / not given / not more than zero) but I guess it could cause problems elsewhere and is probably out of this bug's scope. Swagger offers the tools to fix this nicely ("required" parameter and "minimum"/"exclusiveMinimum" to define min amount). -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org