From e6f5c4711df440119103da8cd250f201e86e6910 Mon Sep 17 00:00:00 2001 From: Andrew Auld Date: Thu, 3 Apr 2025 10:34:47 +0000 Subject: [PATCH] Bug 39543: Error modal when trying to add two controlling licences to an agreement duplicates error message If you try to add two licences with the status 'controlling' to an agreement record, the error modal duplicates the error message 'Only one controlling license is allowed'. Test Plan: 1) Enable ERMModule sys pref 2) Add an agreement record 3) Add two licence records 4) Edit the agreement record and associate both license records to the agreement 5) Try to set both licenses to status 'controlling' 6) Note error modal duplicates the error message 'Only one controlling license is allowed' 7) Apply the patch, run yarn js:build and then hard refresh the browser 8) Repeat steps 1 to 5 and enjoy the single error message! Signed-off-by: Magnus Enger I took the liberty of fixing up the commit message a bit. Signed-off-by: Lisette Scheer Signed-off-by: Katrin Fischer (cherry picked from commit f201ea5076a20e1a8b8d15e0c113afe8ba214793) Signed-off-by: Fridolin Somers --- .../prog/js/vue/components/ERM/AgreementsFormAdd.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue index f7e8d26412..89c981aa01 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue @@ -290,13 +290,6 @@ export default { errors.push(this.$__("Only one controlling license is allowed")) } - if ( - agreement_licenses.filter(al => al.status == "controlling") - .length > 1 - ) { - errors.push(this.$__("Only one controlling license is allowed")) - } - let documents_with_uploaded_files = agreement.documents.filter( doc => typeof doc.file_content !== "undefined" )