From a9b3b6dedb45dd7952e7fd798bba668eecf296ad Mon Sep 17 00:00:00 2001 From: Josh Stompro Date: Wed, 23 Jun 2021 14:21:46 -0500 Subject: [PATCH] LP#1821804 - Cloned patron address set to pending When cloning a patron record, the address gets set to pending and cannot be fixed until the new patron record is saved. The address creation steps for cloned records are a little different if the library setting "Patron Registration: Cloned patrons get address copy" is set, so test with that enabled and disabled. In our system we have that setting enabled. The issue is that the values come in as a string like 't' or 'f' and need to be converted to a boolean value. That is done in the normal address loading code, but wasn't in the cloning code. I also added in a fix for the city limits flag not getting cloned which seems like an related issue. This seems like it was just cosmetic, the city limits does get set when the record is saved, based on the parent records address. Testing Plan: Before change: 1. Enable "Cloned patrons get address copy" setting. 2. Open up a patron record that has a valid non pending address with city limits checked. 3. Save and Clone 4. Notice that the address in the new cloned record says pending. 5. Notice that the city limits checkbox isn't checked. After change applied: 1. Enable "Cloned patrons get address copy" setting. 2. Open up a patron record that has a valid non pending address with city limits checked. 3. Save and Clone 4. Notice that the address in the new cloned record doesn't say pending. 5. Notice that the city limits checkbox is checked. Signed-off-by: Josh Stompro Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index c0913001ed..29725cb21c 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -1017,6 +1017,8 @@ angular.module('egCoreMod') new_addr.usr = user.id; new_addr.isnew = true; new_addr.valid = true; + new_addr.pending = new_addr.pending === 't'; + new_addr.within_city_limits = new_addr.within_city_limits == 't'; user.addresses.push(new_addr); return new_addr; } -- 2.11.0