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 <magnus@libriotech.no>
I took the liberty of fixing up the commit message a bit.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f201ea5076)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Andrew Auld 2025-04-03 10:34:47 +00:00 committed by Fridolin Somers
parent f5ca9d88c6
commit e6f5c4711d
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 0 additions and 7 deletions

View File

@ -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"
)