From dec235fc5579e4832524f13b56e65c9de4fc13ba Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 16 Jun 2023 14:19:48 +0200 Subject: [PATCH] Bug 30708: Deal with deleted authorised value categories If a AV category is renamed or deleted, the app will freeze with "TypeError: av_match is undefined" To prevent that we add an check to prevent the freeze and a warning in the settings. We could eventually add a FK on option_source, but the idea was to let it flexible in case we want to add another source. This bug can be considered a configuration error anyway. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: BULAC - http://www.bulac.fr/ Signed-off-by: Heather Hernandez Signed-off-by: Laurence Rault Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../Preservation/SettingsProcessingsFormAdd.vue | 11 +++++++++++ .../vue/components/Preservation/TrainsFormAddItem.vue | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue index 338eb0dcac..7ca15585e1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue @@ -107,6 +107,17 @@ :id="`attribute_option_${counter}`" v-model="attribute.option_source" :options="authorised_value_categories" + :getOptionLabel=" + c => + authorised_value_categories.find( + cc => cc == c + ) + ? c + : '%s (%s)'.format( + c, + $__('DOES NOT EXIST!') + ) + " >