Bugzilla – Attachment 163625 Details for
Bug 36368
Cannot save new patron after error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36368: Declare template param "op" after variable $op is set
Bug-36368-Declare-template-param-op-after-variable.patch (text/plain), 2.06 KB, created by
Laura Escamilla
on 2024-03-21 14:45:54 UTC
(
hide
)
Description:
Bug 36368: Declare template param "op" after variable $op is set
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-03-21 14:45:54 UTC
Size:
2.06 KB
patch
obsolete
>From 6611a7b486fff275beb3269e5b6d298db988fc8d Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 20 Mar 2024 15:33:21 +0200 >Subject: [PATCH] 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> >--- > members/memberentry.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index b7d8a4a1a4..36312a95f0 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -163,7 +163,6 @@ foreach (@field_check) { > next unless m/\w/o; > $template->param( "no$_" => 1 ); > } >-$template->param( "op" => $op ); > $template->param( "quickadd" => 1 ) if ( $quickadd ); > $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); > $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 ); >@@ -605,6 +604,9 @@ if ($nok or !$nodouble){ > $template->param( step_1 => 1,step_2 => 1,step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1, step_7 => 1 ); > } > } >+ >+$template->param( "op" => $op ); >+ > if (C4::Context->preference("IndependentBranches")) { > my $userenv = C4::Context->userenv; > if ( !C4::Context->IsSuperLibrarian() && $data{'branchcode'} ) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36368
:
163526
|
163624
|
163625
|
164111
|
164112