From 0faad87c87c77c4981bd2359fe16829a919bfc48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 28 Aug 2023 15:53:16 +0200 Subject: [PATCH] #1088: ensure multi-BU retrieves do not interact badly with each other --- lib/metadataTypes/AttributeSet.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/metadataTypes/AttributeSet.js b/lib/metadataTypes/AttributeSet.js index 575531ee7..0a782c18c 100644 --- a/lib/metadataTypes/AttributeSet.js +++ b/lib/metadataTypes/AttributeSet.js @@ -345,8 +345,11 @@ class AttributeSet extends MetadataType { * @returns {object[]} all system value definitions */ static _getSystemValueDefinitions() { - if (!this.systemValueDefinitions) { - this.systemValueDefinitions = Object.values(cache.getCache()['attributeSet']) + this.systemValueDefinitions ||= {}; + if (!this.systemValueDefinitions[this.buObject.mid]) { + this.systemValueDefinitions[this.buObject.mid] = Object.values( + cache.getCache()['attributeSet'] + ) .flatMap((item) => { if (item.isSystemDefined) { return item.valueDefinitions; @@ -354,7 +357,7 @@ class AttributeSet extends MetadataType { }) .filter(Boolean); } - return this.systemValueDefinitions; + return this.systemValueDefinitions[this.buObject.mid]; } }