From 42b8953a1be053f45350ad5bcc8c8e123d9bda56 Mon Sep 17 00:00:00 2001 From: Ruben Bert Pingol Date: Sun, 21 Apr 2024 09:20:43 +0800 Subject: [PATCH] Dataset: Fix number row that shows as string relates to xibosignage/xibo#3405 --- ui/src/helpers/player-helper.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/src/helpers/player-helper.js b/ui/src/helpers/player-helper.js index 1bb03afac0..0049b8069b 100644 --- a/ui/src/helpers/player-helper.js +++ b/ui/src/helpers/player-helper.js @@ -281,6 +281,27 @@ const PlayerHelper = function() { {group: groupObj}, ); + // Handle special cases where data field name for override + // that's the same as template variable + // E.g. When a dataset column is "text" and the element is using + // text element, extended or not + if (props.isExtended) { + if (props.type === 'dataset' && + props.hasOwnProperty('datasetField') && + dataItem.hasOwnProperty(props.datasetField) + ) { + props[props.dataOverride] = dataItem[props.datasetField]; + } else { + const extendWith = + transformer.getExtendedDataKey(props.dataOverrideWith); + if (props.dataOverride === extendWith && + dataItem.hasOwnProperty(extendWith) + ) { + props[props.dataOverride] = dataItem[extendWith]; + } + } + } + $itemContainer.append( self.renderElement( item.hbs,