Skip to content

Commit 7d31a92

Browse files
Fix: data widget fetching and parsing (#2868)
* Add fix to data widget fetching and parsing * Bump XLR version
1 parent 348905f commit 7d31a92

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

lib/Widget/Render/WidgetHtmlRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public function decorateForPlayer(
362362
): string {
363363
// Do we need to add a URL prefix to the requests?
364364
$auth = $display->isPwa()
365-
? '&v=7&serverKey=' . $this->config->getSetting('serverKey') . '&hardwareKey=' . $display->license
365+
? '&v=7&serverKey=' . $this->config->getSetting('SERVER_KEY') . '&hardwareKey=' . $display->license
366366
: null;
367367
$encryptionKey = $this->config->getApiKeyDetails()['encryptionKey'];
368368

modules/src/xibo-player.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,22 @@ const XiboPlayer = function() {
5555
$.ajax({
5656
method: 'GET',
5757
url: currentWidget.url,
58+
dataType: 'json',
5859
}).done(function(data) {
5960
// The contents of the JSON file will be an object with data and meta
6061
// add in local data.
6162
if (localData) {
6263
data.data = localData;
6364
}
6465

66+
let widgetData = data;
67+
68+
if (typeof widgetData === 'string') {
69+
widgetData = JSON.parse(data);
70+
}
71+
6572
resolve({
66-
...data,
73+
...widgetData,
6774
isDataReady: true,
6875
});
6976
}).fail(function(jqXHR, textStatus, errorThrown) {

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@mapbox/leaflet-pip": "^1.1.0",
6666
"@popperjs/core": "^2.11.8",
6767
"@ssddanbrown/codemirror-lang-twig": "^1.0.0",
68-
"@xibosignage/xibo-layout-renderer": "^1.0.6",
68+
"@xibosignage/xibo-layout-renderer": "^1.0.11",
6969
"@xiechao/codemirror-lang-handlebars": "^1.0.4",
7070
"ajax-bootstrap-select": "^1.4.5",
7171
"blueimp-file-upload": "^10.32.0",

0 commit comments

Comments
 (0)