Skip to content

Commit

Permalink
Add fix to data widget fetching and parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenberttpingol committed Jan 23, 2025
1 parent 09d8a98 commit b8e1162
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/Widget/Render/WidgetHtmlRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function decorateForPlayer(
): string {
// Do we need to add a URL prefix to the requests?
$auth = $display->isPwa()
? '&v=7&serverKey=' . $this->config->getSetting('serverKey') . '&hardwareKey=' . $display->license
? '&v=7&serverKey=' . $this->config->getSetting('SERVER_KEY') . '&hardwareKey=' . $display->license
: null;
$encryptionKey = $this->config->getApiKeyDetails()['encryptionKey'];

Expand Down
9 changes: 8 additions & 1 deletion modules/src/xibo-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,22 @@ const XiboPlayer = function() {
$.ajax({
method: 'GET',
url: currentWidget.url,
dataType: 'json',
}).done(function(data) {
// The contents of the JSON file will be an object with data and meta
// add in local data.
if (localData) {
data.data = localData;
}

let widgetData = data;

if (typeof widgetData === 'string') {
widgetData = JSON.parse(data);
}

resolve({
...data,
...widgetData,
isDataReady: true,
});
}).fail(function(jqXHR, textStatus, errorThrown) {
Expand Down
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@mapbox/leaflet-pip": "^1.1.0",
"@popperjs/core": "^2.11.8",
"@ssddanbrown/codemirror-lang-twig": "^1.0.0",
"@xibosignage/xibo-layout-renderer": "^1.0.6",
"@xibosignage/xibo-layout-renderer": "^1.0.10",
"@xiechao/codemirror-lang-handlebars": "^1.0.4",
"ajax-bootstrap-select": "^1.4.5",
"blueimp-file-upload": "^10.32.0",
Expand Down

0 comments on commit b8e1162

Please sign in to comment.