From 52f928beb013942d13d0fabf420a5ea7d2c29f6c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 30 Jul 2024 12:13:23 +0000 Subject: [PATCH] Bug 37523: CSRF error when modifying an existing patron record MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch modifies the patron entry template to avoid a CSRF error when clicking the "Edit existing record" button after a duplicate patron is found. The operation should be GET and thus can be a link. To test, apply the patch and go to Patrons. - If you aren't using the default testing data you should first locate an existing patron record so you can refer to the details. - Start the process of creating a new patron record. - Use the existing patron's data to fill out the form. - With the default data you can use: - Surname: Bennett - First name: Pamela - Date of birth: 09/16/1946 - Any random new card number - When you click "Save" you should get a duplicate patron warning: "Duplicate patron record?" - Click "It is a duplicate. Edit existing record." - You should be taken to the edit form for the existing patron. Sponsored-by: Athens County Public Libraries Signed-off-by: Roman Dolny Signed-off-by: Johanna Räisä Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer (cherry picked from commit 2f6226ad695a7092c71ba86d06bd9d7edac8f583) Signed-off-by: Lucas Gass --- .../prog/en/modules/members/memberentrygen.tt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 6877ef453f..fe81a88bb8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -144,7 +144,7 @@ legend.collapsed i.fa.fa-caret-down::before {

Duplicate patron record?

View existing record

- + It is a duplicate. Edit existing record
[% END %] @@ -1951,13 +1951,6 @@ legend.collapsed i.fa.fa-caret-down::before { } }); - $('#duplicate').on('click', function() { - $("input[name='op']").val('edit_form'); - $("input[name='borrowernumber']").val('[% check_member | html %]'); - $("input[name='check_member']").val(''); - $('#entryform').submit(); - }); - $('#not-duplicate').on('click', function() { $("input[name='nodouble']").val('1'); $('#entryform').submit(); -- 2.39.5