force attribute value to be a string, closes #2104

This commit is contained in:
zadam
2021-08-12 20:42:35 +02:00
parent 86a53ceebb
commit 13a16e8251
3 changed files with 11283 additions and 77 deletions

View File

@@ -906,6 +906,8 @@ class Note extends AbstractEntity {
const attributes = this.getOwnedAttributes();
const attr = attributes.find(attr => attr.type === type && attr.name === name);
value = value !== null && value !== undefined ? value.toString() : "";
if (attr) {
if (attr.value !== value) {
attr.value = value;
@@ -919,7 +921,7 @@ class Note extends AbstractEntity {
noteId: this.noteId,
type: type,
name: name,
value: value !== undefined ? value : ""
value: value
}).save();
}
}