From 994d3d6adcc190908b45f0ae97ce93ff7033c4a7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 15 May 2019 14:02:59 +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 Signed-off-by: Owen Leonard --- members/memberentry.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/members/memberentry.pl b/members/memberentry.pl index 1663020..bc6ec7d 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -885,6 +885,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.1.4