Bug 33176: Enforce bad values
authorLucas Gass <lucas@bywatersolutions.com>
Wed, 7 Jun 2023 18:40:48 +0000 (18:40 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 17 Jul 2023 07:15:11 +0000 (08:15 +0100)
commit6be23e725134cf2d5f20279b209b0a8aa62aaa90
treeca731ecc8bb483826aa1f3ffd51fec58f0b0aa8a
parent68c725afeec87d4cd6bddb78323c2d5c66969901
Bug 33176: Enforce bad values

1. Turn on RequirePaymentType
2. Create a manual invocie on a patron account
3. Go to pay it, 'Payment type:' is marked as required.
4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute.
5. You are able to make the payment without a payment type.
6. Apply patch and restart_all
7. Try 4-5 again. This time you should get a 500 error and the payment should not go through.
8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'.
9. Try to submit the payment and again you will get a 500 error. The payment should not go through.
10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful.
11. Make sure tests will pass

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 676d263687ad666184fce6d505af6d9672412732)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Account.pm
Koha/Exceptions/Account.pm
t/db_dependent/Koha/Account.t