Bug 38201: Fix setWarning call in titles+packages

'this' is scoped inside forEarch, an error was thrown when submiting the form with errors

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-04-08 13:43:28 +00:00 committed by Lucas Gass
parent 4cd93c87cf
commit e05e0f1f1d
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 2 additions and 6 deletions

View File

@ -311,9 +311,7 @@ export default {
errors.push(this.$__("An agreement is used several times"));
}
errors.forEach(function (e) {
this.setWarning(e);
});
this.setWarning(errors.join("<br>"));
return !errors.length;
},
onSubmit(e, packageToSave) {

View File

@ -439,9 +439,7 @@ export default {
errors.push(this.$__("A package is used several times"));
}
errors.forEach(function (e) {
this.setWarning(e);
});
this.setWarning(errors.join("<br>"));
return !errors.length;
},
onSubmit(e, titleToSave) {