https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15165
--- Comment #47 from Lari Taskula <[email protected]> --- (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. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
