From 2924fb81f0eda761085323ce07324f76131f4961 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 May 2024 10:05:16 +0200 Subject: [PATCH] Bug 36816: Restore clearing patron attributes - OPAC 1) Add a new patron attribute type, visit: /cgi-bin/koha/admin/patron-attr-types.pl?op=add_attribute_type 2) Add a code and a description (whatever) - Make it 'Display in OPAC' and 'Editable in OPAC' 3) Access OPAC patron personal details page, visit: /cgi-bin/koha/opac-memberentry.pl 4) Scroll down and add some info to 'whatever'. Click 'Submit update request'. 5) Visit the INTRA 'update patron requests from opac' page: /cgi-bin/koha/members/members-update.pl 6) Notice the entry is there. Select 'approve' and click "Submit" 7) Repeat 3) 8) Scroll down and notice the approved value is there. Clear that data and "Submit update request" (as if you're requesting for that data to be removed/cleared) 9) Repeat 5) 10) Notice there's an entry, and it is not empty. Select 'approve' and click "Submit" 11) Repeat 3) 12) Scroll down and notice the request to update (clear) that field did go through, i.e. the data is not there anymore. Also test self-registration and mandatory attributes Signed-off-by: Pedro Amorim --- opac/opac-memberentry.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 4577b25a64..cc350990d2 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -756,7 +756,7 @@ sub ParsePatronAttributes { } foreach my $code ( keys %{$delete_candidates} ) { - if ( not $borrowernumber # self-registration + if ( !$borrowernumber # self-registration || Koha::Patron::Attributes->search({ borrowernumber => $borrowernumber, code => $code })->count > 0 ) { -- 2.39.2