From: Bill Erickson Date: Mon, 2 May 2022 15:44:19 +0000 (-0400) Subject: LP1904036 Patron editor honor reg_default for settings X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f6619acee738912540c3682b1f348ba6f453bcc8;p=Evergreen.git LP1904036 Patron editor honor reg_default for settings Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index 983ce0c4a9..9949318f8c 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -701,6 +701,19 @@ export class EditComponent implements OnInit, AfterViewInit { if (!COMMON_USER_SETTING_TYPES.includes(stype.name())) { this.optInSettingTypes[stype.name()] = stype; } + + if (this.patron.isnew()) { + let val = stype.reg_default(); + if (val !== null && val !== undefined) { + if (stype.datatype() === 'bool') { + // A boolean user setting type whose default + // value starts with t/T is considered 'true', + // false otherwise. + val = Boolean((val + '').match(/^t/i)); + } + this.userSettings[stype.name()] = val + } + } }); }); }