Bug 36368: Declare template param "op" after variable $op is set
authorEmmi Takkinen <emmi.takkinen@koha-suomi.fi>
Wed, 20 Mar 2024 13:33:21 +0000 (15:33 +0200)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Tue, 2 Apr 2024 15:59:08 +0000 (17:59 +0200)
commitdac285957ddda4d2d865c3a72441fa599301548a
tree144e9ccabd8ccb9a4b751dd53587987a4d2f5fd9
parentf8665c8d55b4526f6f21f3b7b9c80c8e7ca4e624
Bug 36368: Declare template param "op" after variable $op is set

If an error occurs while adding new patron, after fixing the error and
hitting save, patron entry page reloads to "Modify patron" section
and error "Patron not found. Return to search" is displayed. But no
patron is saved.

This happens because we declare template param op too early in the
code and it receives value "cud-insert" instead of "add_form" as it should.

To test:
1. Add new patron and cause an error (wrong age etc.).
2. Attempt to save patron, error message is displayed.
3. Fix your errors and attempt to save again.
=> Error message "Patron not found. Return to search" is displayed and new
patron is not saved to database.
4. Apply this patch.
5. Repeat steps from 1 to 3.
=> Saving patron should now work.
=> To be save, test if modifying patron also works as it should.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
members/memberentry.pl