Bugzilla – Attachment 90173 Details for
Bug 22910
Unique attributes should not be copied when duplicating a patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22910 - Do not copy unique patron attributes to duplicated patron
0001-Bug-22910-Do-not-copy-unique-patron-attributes-to-du.patch (text/plain), 2.08 KB, created by
paxed
on 2019-05-29 06:22:26 UTC
(
hide
)
Description:
Bug 22910 - Do not copy unique patron attributes to duplicated patron
Filename:
MIME Type:
Creator:
paxed
Created:
2019-05-29 06:22:26 UTC
Size:
2.08 KB
patch
obsolete
>From 75a1d2f8a86901bcab40353a951f9b65b901c8f5 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> >Date: Wed, 29 May 2019 09:20:43 +0300 >Subject: [PATCH] Bug 22910 - Do not copy unique patron attributes to > duplicated patron > >When creating a new patron by duplicating another, all of the patron >attributes are also copied into the form. Some of those value may be >unique, so don't copy those. > >1) Create patron attribute types, one with "unique identifier", one without. >2) Create or a patron so it has values in both of those attributes. >3) Duplicate the patron >4) The edit form should retain the values from the "original" patron. >5) Apply patch. >6) Duplicate the patron - this time the attributes with unique values > are cleared. > >Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> >--- > members/memberentry.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 166302006b..7553d1a07e 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -747,7 +747,7 @@ foreach (qw(dateenrolled dateexpiry dateofbirth)) { > } > > if (C4::Context->preference('ExtendedPatronAttributes')) { >- patron_attributes_form($template, $borrowernumber); >+ patron_attributes_form($template, $borrowernumber, $op); > } > > if (C4::Context->preference('EnhancedMessagingPreferences')) { >@@ -846,6 +846,7 @@ sub parse_extended_patron_attributes { > sub patron_attributes_form { > my $template = shift; > my $borrowernumber = shift; >+ my $op = shift; > > my @types = C4::Members::AttributeTypes::GetAttributeTypes(); > if (scalar(@types) == 0) { >@@ -885,6 +886,7 @@ sub patron_attributes_form { > $newentry->{auth_val_loop} = GetAuthorisedValues($attr_type->authorised_value_category(), $attr->{value}); > } > $i++; >+ undef $newentry->{value} if ($attr_type->unique_id() && $op eq 'duplicate'); > $newentry->{form_id} = "patron_attr_$i"; > push @{$items_by_class{$attr_type->class()}}, $newentry; > } >-- >2.11.0 >
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 22910
:
89782
|
89783
|
90173
|
90218