Bug 42002: Make 'replace' in screen_msg_regex not required

Default to empty string if null to ensure that leaving it blank produces the required outcome: the replace value is an empty string

Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Pedro Amorim 2026-03-05 15:26:40 +00:00
parent d294b2ce2a
commit c420f23125
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 9 additions and 1 deletions

View File

@ -845,7 +845,6 @@ export default {
},
{
name: "replace",
required: true,
indexRequired: true,
type: "text",
placeholder: "Welcome to your library!",
@ -1025,6 +1024,15 @@ export default {
account.convert_nonprinting_characters = null;
}
if (account.screen_msg_regexs) {
account.screen_msg_regexs = account.screen_msg_regexs.map(
item => ({
...item,
replace: item.replace ?? "",
})
);
}
account.item_fields = account.item_fields?.map(
({ account_id, account_item_field_id, ...rest }) => rest
);