Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.0.13 #2611

Merged
merged 23 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6b8c87a
Module: webpage widget should use original width/height (which is reg…
dasgarner Jun 14, 2024
846f61a
Module: HTML cache can be generated via XMDS which fails for HLS. (#2…
dasgarner Jun 14, 2024
3a2c2f9
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 16, 2024
0649b83
Module: improve the way widget data is cached and returned (#2566)
dasgarner Jun 17, 2024
4c312c1
Merge pull request #2573 from xibosignage/dependabot/npm_and_yarn/bra…
dasgarner Jun 17, 2024
df21d36
XMDS: deadlocks occurring when a lot of displays make concurrent conn…
dasgarner Jun 20, 2024
7f42e3f
securing github workflow input https://github.com/xibosignageltd/xibo…
ifarzana Jun 26, 2024
2a569ed
/schedule/view shows no events when mobile layout is used. (#2584)
maurofmferrao Jun 28, 2024
219b5e4
Bandwidth Report: Fixed Table/Chart is not showing any data (#2596)
mgbaybay Jul 2, 2024
f8c64ac
Connector: Fixed file based settings should override database setting…
mgbaybay Jul 2, 2024
12a8152
Dashboard: remove unused code to improve page load performance. (#2571)
dasgarner Jul 2, 2024
3389483
Data Widget: increasing/decreasing the number of slots does not updat…
dasgarner Jul 3, 2024
1c9524f
Schedule: fix monthly repeat and from/to dates for timezone. (#2600)
dasgarner Jul 3, 2024
040159d
Stocks: Incorrect calculation of Total Duration for elements with Dur…
maurofmferrao Jul 4, 2024
fc3ae50
Misc improvements with sanitization, etc (#2604)
dasgarner Jul 4, 2024
257243e
Widget: Weather widget no data message handled on xibo-player JS (#2605)
rubenberttpingol Jul 4, 2024
515b6a1
Media: Fixed image not updating values when resizing (#2602)
mgbaybay Jul 4, 2024
6d572da
Editor: Bottom-bar not rendering when leaving multi-select (#2608)
maurofmferrao Jul 4, 2024
215b54f
PlayerJS: Fix marquee up/down scroll
dasgarner Jul 4, 2024
91d1c44
Connector: Fix for Open Weather Map paid plan (#2603)
nadzpogi Jul 5, 2024
0331f12
Release: preparation for 4.0.13 (#2609)
dasgarner Jul 5, 2024
136879f
Editor: Adding the first data element throws a console error (#2610)
maurofmferrao Jul 5, 2024
e8e6008
Fix for older JS rendering engines (#2612)
maurofmferrao Jul 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ jobs:
# Step 4: The Rest
- name: Check Comment
id: check_comment
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
comment_body="${{ github.event.comment.body }}"
if [[ "$comment_body" =~ TEST:\ (all|\*) ]]; then
# Sanitize and validate comment body for TEST command
if [[ "$COMMENT_BODY" =~ ^TEST:\ (all|\*)$ ]]; then
test_all=true
elif [[ "$comment_body" =~ TEST:(.*?)END ]]; then
elif [[ "$COMMENT_BODY" =~ ^TEST:(.*?)END$ ]]; then
specs="${BASH_REMATCH[1]}"
# Split the content by commas and remove spaces
IFS=',' read -ra content_array <<< "$specs"
Expand All @@ -46,7 +48,7 @@ jobs:
content_array=("${content_array[@]%/}")
# Add "/app/cypress/e2e/" prefix to each element
for ((i=0; i<${#content_array[@]}; i++)); do
content_array[$i]="/app/cypress/e2e/${content_array[$i]}"
content_array[$i]="/app/cypress/e2e/${content_array[$i]}"
done
# Join the content array elements with commas
content_no_spaces="$(IFS=','; echo "${content_array[*]}")"
Expand Down
7 changes: 1 addition & 6 deletions lib/Connector/OpenWeatherMapConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,13 @@ class OpenWeatherMapConnector implements ConnectorInterface
private $forecast3Hourly = '2.5/forecast';
private $forecastDaily = '2.5/forecast/daily';
private $forecastCombinedV3 = '3.0/onecall';
private $forecastUv = 'uvi';

/** @var string */
protected $timezone;

/** @var \Xibo\Widget\DataType\Forecast */
protected $currentDay;

/** @var \Xibo\Widget\DataType\Forecast[] */
protected $forecast;

public function registerWithDispatcher(EventDispatcherInterface $dispatcher): ConnectorInterface
{
$dispatcher->addListener(WidgetDataRequestEvent::$NAME, [$this, 'onDataRequest']);
Expand Down Expand Up @@ -90,8 +86,7 @@ public function processSettingsForm(SanitizerInterface $params, array $settings)
{
if (!$this->isProviderSetting('owmApiKey')) {
$settings['owmApiKey'] = $params->getString('owmApiKey');
$settings['owmApiVersion'] = $params->getString('owmApiVersion');
$settings['owmIsPaidPlan'] = $params->getString('owmIsPaidPlan');
$settings['owmIsPaidPlan'] = $params->getCheckbox('owmIsPaidPlan');
$settings['cachePeriod'] = $params->getInt('cachePeriod');
}
return $settings;
Expand Down
9 changes: 1 addition & 8 deletions lib/Controller/DataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1198,24 +1198,17 @@ public function import(Request $request, Response $response, $id)

$sanitizer = $this->getSanitizer($request->getParams());


$options = array(
'userId' => $this->getUser()->userId,
'dataSetId' => $id,
'controller' => $this,
'upload_dir' => $libraryFolder . 'temp/',
'download_via_php' => true,
'script_url' => $this->urlFor($request,'dataSet.import', ['id' => $id]),
'upload_url' => $this->urlFor($request,'dataSet.import', ['id' => $id]),
'image_versions' => array(),
'accept_file_types' => '/\.csv/i',
'sanitizer' => $sanitizer
);

try {
// Hand off to the Upload Handler provided by jquery-file-upload
new DataSetUploadHandler($options);

new DataSetUploadHandler($libraryFolder . 'temp/', $this->getLog()->getLoggerInterface(), $options);
} catch (\Exception $e) {
// We must not issue an error, the file upload return should have the error object already
$this->getState()->setCommitState(false);
Expand Down
1 change: 0 additions & 1 deletion lib/Controller/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,6 @@ function edit(Request $request, Response $response, $id)

// Tags are stored on the displaygroup, we're just passing through here
if ($this->getUser()->featureEnabled('tag.tagging')) {
$display->setOriginalValue('tags', $display->tags);
if (is_array($sanitizedParams->getParam('tags'))) {
$tags = $this->tagFactory->tagsFromJson($sanitizedParams->getArray('tags'));
} else {
Expand Down
16 changes: 6 additions & 10 deletions lib/Controller/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
use Xibo\Factory\FontFactory;
use Xibo\Helper\ByteFormatter;
use Xibo\Helper\HttpCacheProvider;
use Xibo\Helper\UploadHandler;
use Xibo\Service\DownloadService;
use Xibo\Service\MediaService;
use Xibo\Service\MediaServiceInterface;
Expand Down Expand Up @@ -381,9 +380,6 @@ public function add(Request $request, Response $response)
$libraryLimit = $this->getConfig()->getSetting('LIBRARY_SIZE_LIMIT_KB') * 1024;

$options = [
'upload_dir' => $libraryFolder . 'temp/',
'script_url' => $this->urlFor($request, 'font.add'),
'upload_url' => $this->urlFor($request, 'font.add'),
'accept_file_types' => '/\.' . implode('|', $validExt) . '$/i',
'libraryLimit' => $libraryLimit,
'libraryQuotaFull' => ($libraryLimit > 0 && $this->getMediaService()->libraryUsage() > $libraryLimit),
Expand All @@ -395,20 +391,19 @@ public function add(Request $request, Response $response)
$this->getLog()->debug('Hand off to Upload Handler with options: ' . json_encode($options));

// Hand off to the Upload Handler provided by jquery-file-upload
$uploadService = new UploadService($options, $this->getLog(), $this->getState());
$uploadService = new UploadService($libraryFolder . 'temp/', $options, $this->getLog(), $this->getState());
$uploadHandler = $uploadService->createUploadHandler();

$uploadHandler->setPostProcessor(function ($file, $uploadHandler) {
$uploadHandler->setPostProcessor(function ($file, $uploadHandler) use ($libraryFolder) {
// Return right away if the file already has an error.
if (!empty($file->error)) {
return $file;
}

$this->getUser()->isQuotaFullByUser(true);

/** @var UploadHandler $uploadHandler */
$filePath = $uploadHandler->getUploadPath() . $file->fileName;
$libraryLocation = $this->getConfig()->getSetting('LIBRARY_LOCATION');
// Get the uploaded file and move it to the right place
$filePath = $libraryFolder . 'temp/' . $file->fileName;

// Add the Font
$font = $this->getFontFactory()
Expand All @@ -424,7 +419,7 @@ public function add(Request $request, Response $response)
}

// everything is fine, move the file from temp folder.
rename($filePath, $libraryLocation . 'fonts/' . $font->fileName);
rename($filePath, $libraryFolder . 'fonts/' . $font->fileName);

// return
$file->id = $font->id;
Expand All @@ -434,6 +429,7 @@ public function add(Request $request, Response $response)
return $file;
});

// Handle the post request
$uploadHandler->post();

// all done, refresh fonts.css
Expand Down
6 changes: 1 addition & 5 deletions lib/Controller/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -2560,10 +2560,6 @@ public function import(Request $request, Response $response)
'userId' => $this->getUser()->userId,
'controller' => $this,
'dataSetFactory' => $this->getDataSetFactory(),
'upload_dir' => $libraryFolder . 'temp/',
'download_via_php' => true,
'script_url' => $this->urlFor($request, 'layout.import'),
'upload_url' => $this->urlFor($request, 'layout.import'),
'image_versions' => [],
'accept_file_types' => '/\.zip$/i',
'libraryLimit' => $libraryLimit,
Expand All @@ -2576,7 +2572,7 @@ public function import(Request $request, Response $response)
$this->setNoOutput(true);

// Hand off to the Upload Handler provided by jquery-file-upload
new LayoutUploadHandler($options);
new LayoutUploadHandler($libraryFolder . 'temp/', $this->getLog()->getLoggerInterface(), $options);

// Explicitly set the Content-Type header to application/json
$response = $response->withHeader('Content-Type', 'application/json');
Expand Down
7 changes: 1 addition & 6 deletions lib/Controller/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -1199,11 +1199,6 @@ public function add(Request $request, Response $response)
'allowMediaTypeChange' => $options['allowMediaTypeChange'],
'displayOrder' => $parsedBody->getInt('displayOrder'),
'playlistId' => $parsedBody->getInt('playlistId'),
'upload_dir' => $libraryFolder . 'temp/',
'download_via_php' => true,
'script_url' => $this->urlFor($request,'library.add'),
'upload_url' => $this->urlFor($request,'library.add'),
'image_versions' => [],
'accept_file_types' => '/\.' . implode('|', $validExt) . '$/i',
'libraryLimit' => $libraryLimit,
'libraryQuotaFull' => ($libraryLimit > 0 && $this->getMediaService()->libraryUsage() > $libraryLimit),
Expand All @@ -1220,7 +1215,7 @@ public function add(Request $request, Response $response)
$this->getLog()->debug('Hand off to Upload Handler with options: ' . json_encode($options));

// Hand off to the Upload Handler provided by jquery-file-upload
new XiboUploadHandler($options);
new XiboUploadHandler($libraryFolder . 'temp/', $this->getLog()->getLoggerInterface(), $options);

// Explicitly set the Content-Type header to application/json
$response = $response->withHeader('Content-Type', 'application/json');
Expand Down
7 changes: 1 addition & 6 deletions lib/Controller/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,6 @@ public function addAttachment(Request $request, Response $response)
$options = array(
'userId' => $this->getUser()->userId,
'controller' => $this,
'upload_dir' => $libraryFolder . 'temp/',
'download_via_php' => true,
'script_url' => $this->urlFor($request,'notification.add'),
'upload_url' => $this->urlFor($request,'notification.add'),
'image_versions' => array(),
'accept_file_types' => '/\.jpg|.jpeg|.png|.bmp|.gif|.zip|.pdf/i'
);

Expand All @@ -418,7 +413,7 @@ public function addAttachment(Request $request, Response $response)
$this->getLog()->debug('Hand off to Upload Handler with options: ' . json_encode($options));

// Hand off to the Upload Handler provided by jquery-file-upload
new AttachmentUploadHandler($options);
new AttachmentUploadHandler($libraryFolder . 'temp/', $this->getLog()->getLoggerInterface(), $options);

// Explicitly set the Content-Type header to application/json
$response = $response->withHeader('Content-Type', 'application/json');
Expand Down
15 changes: 5 additions & 10 deletions lib/Controller/PlayerSoftware.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use Xibo\Factory\ModuleFactory;
use Xibo\Factory\PlayerVersionFactory;
use Xibo\Helper\ByteFormatter;
use Xibo\Helper\UploadHandler;
use Xibo\Service\DownloadService;
use Xibo\Service\MediaService;
use Xibo\Service\MediaServiceInterface;
Expand Down Expand Up @@ -576,9 +575,6 @@ public function add(Request $request, Response $response)
$libraryLimit = $this->getConfig()->getSetting('LIBRARY_SIZE_LIMIT_KB') * 1024;

$options = [
'upload_dir' => $libraryFolder . 'temp/',
'script_url' => $this->urlFor($request, 'playersoftware.add'),
'upload_url' => $this->urlFor($request, 'playersoftware.add'),
'accept_file_types' => '/\.' . implode('|', $validExt) . '$/i',
'libraryLimit' => $libraryLimit,
'libraryQuotaFull' => ($libraryLimit > 0 && $this->getMediaService()->libraryUsage() > $libraryLimit),
Expand All @@ -590,10 +586,10 @@ public function add(Request $request, Response $response)
$this->getLog()->debug('Hand off to Upload Handler with options: ' . json_encode($options));

// Hand off to the Upload Handler provided by jquery-file-upload
$uploadService = new UploadService($options, $this->getLog(), $this->getState());
$uploadService = new UploadService($libraryFolder . 'temp/', $options, $this->getLog(), $this->getState());
$uploadHandler = $uploadService->createUploadHandler();

$uploadHandler->setPostProcessor(function ($file, $uploadHandler) {
$uploadHandler->setPostProcessor(function ($file, $uploadHandler) use ($libraryFolder) {
// Return right away if the file already has an error.
if (!empty($file->error)) {
$this->getState()->setCommitState(false);
Expand All @@ -602,9 +598,8 @@ public function add(Request $request, Response $response)

$this->getUser()->isQuotaFullByUser(true);

/** @var UploadHandler $uploadHandler */
$filePath = $uploadHandler->getUploadPath() . $file->fileName;
$libraryLocation = $this->getConfig()->getSetting('LIBRARY_LOCATION');
// Get the uploaded file and move it to the right place
$filePath = $libraryFolder . 'temp/' . $file->fileName;

// Add the Player Software record
$playerSoftware = $this->getPlayerVersionFactory()->createEmpty();
Expand Down Expand Up @@ -633,7 +628,7 @@ public function add(Request $request, Response $response)
}

// everything is fine, move the file from temp folder.
rename($filePath, $libraryLocation . 'playersoftware/' . $playerSoftware->fileName);
rename($filePath, $libraryFolder . 'playersoftware/' . $playerSoftware->fileName);

// return
$file->id = $playerSoftware->versionId;
Expand Down
29 changes: 25 additions & 4 deletions lib/Controller/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2284,8 +2284,9 @@ public function grid(Request $request, Response $response)
], $params)
);

// Setting for whether we show Layouts with out permissions
// Grab some settings which determine how events are displayed.
$showLayoutName = ($this->getConfig()->getSetting('SCHEDULE_SHOW_LAYOUT_NAME') == 1);
$defaultTimezone = $this->getConfig()->getSetting('defaultTimezone');

foreach ($events as $event) {
$event->load();
Expand Down Expand Up @@ -2348,15 +2349,25 @@ public function grid(Request $request, Response $response)
$i++;
}
} else if ($event->recurrenceType === 'Month') {
// Force the timezone for this date (schedule from/to dates are timezone agnostic, but this
// date still has timezone information, which could lead to use formatting as the wrong day)
$date = Carbon::parse($event->fromDt)->tz($defaultTimezone);
$this->getLog()->debug('grid: setting description for monthly event with date: '
. $date->toAtomString());

if ($event->recurrenceMonthlyRepeatsOn === 0) {
$repeatsOn = 'the ' . Carbon::parse($event->fromDt)->format('jS') . ' day of the month';
$repeatsOn = 'the ' . $date->format('jS') . ' day of the month';
} else {
$date = Carbon::parse($event->fromDt);
// Which day of the month is this?
$firstDay = Carbon::parse('first ' . $date->format('l') . ' of ' . $date->format('F'));

$this->getLog()->debug('grid: the first day of the month for this date is: '
. $firstDay->toAtomString());

$nth = $firstDay->diffInDays($date) / 7 + 1;
$repeatWeekDayDate = $date->copy()->setDay($nth)->format('jS');
$repeatsOn = 'the ' . $repeatWeekDayDate . ' '
. Carbon::parse($event->fromDt)->format('l')
. $date->format('l')
. ' of the month';
}
}
Expand Down Expand Up @@ -2391,6 +2402,16 @@ public function grid(Request $request, Response $response)
$event->toDt = $event->fromDt;
}

// Set the row from/to date to be an ISO date for display (no timezone)
$event->setUnmatchedProperty(
'displayFromDt',
Carbon::createFromTimestamp($event->fromDt)->format(DateFormatHelper::getSystemFormat())
);
$event->setUnmatchedProperty(
'displayToDt',
Carbon::createFromTimestamp($event->toDt)->format(DateFormatHelper::getSystemFormat())
);

if ($this->isApi($request)) {
continue;
}
Expand Down
14 changes: 1 addition & 13 deletions lib/Controller/StatusDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,9 @@ public function displayPage(Request $request, Response $response)
$data['libraryWidgetData'] = json_encode($libraryUsage);

// Get a count of users
$data['countUsers'] = count($this->userFactory->query());
$data['countUsers'] = $this->userFactory->count();

// Get a count of active layouts, only for display groups we have permission for
$displayGroups = $this->displayGroupFactory->query(null, ['isDisplaySpecific' => -1]);
$displayGroupIds = array_map(function ($element) {
return $element->displayGroupId;
}, $displayGroups);
// Add an empty one
$displayGroupIds[] = -1;

$params = ['now' => Carbon::now()->format('U')];

$sql = '
Expand Down Expand Up @@ -422,18 +415,14 @@ public function displayPage(Request $request, Response $response)

// Display Status and Media Inventory data - Level one
$displays = $this->displayFactory->query();
$displayIds = [];
$displayLoggedIn = [];
$displayNames = [];
$displayMediaStatus = [];
$displaysOnline = 0;
$displaysOffline = 0;
$displaysMediaUpToDate = 0;
$displaysMediaNotUpToDate = 0;

foreach ($displays as $display) {
$displayIds[] = $display->displayId;
$displayNames[] = $display->display;
$displayLoggedIn[] = $display->loggedIn;
$displayMediaStatus[] = $display->mediaInventoryStatus;
}
Expand All @@ -456,7 +445,6 @@ public function displayPage(Request $request, Response $response)

$data['displayStatus'] = json_encode([$displaysOnline, $displaysOffline]);
$data['displayMediaStatus'] = json_encode([$displaysMediaUpToDate, $displaysMediaNotUpToDate]);
$data['displayLabels'] = json_encode($displayNames);
} catch (Exception $e) {
$this->getLog()->error($e->getMessage());
$this->getLog()->debug($e->getTraceAsString());
Expand Down
6 changes: 5 additions & 1 deletion lib/Controller/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Xibo\Event\DisplayGroupLoadEvent;
use Xibo\Event\TagDeleteEvent;
use Xibo\Event\TagEditEvent;
use Xibo\Event\TriggerTaskEvent;
use Xibo\Factory\CampaignFactory;
use Xibo\Factory\DisplayFactory;
use Xibo\Factory\DisplayGroupFactory;
Expand Down Expand Up @@ -743,7 +744,10 @@ public function editMultiple(Request $request, Response $response)
// Once we're done, and if we're a Display entity, we need to calculate the dynamic display groups
if ($targetType === 'display') {
// Background update.
$this->getConfig()->changeSetting('DYNAMIC_DISPLAY_GROUP_ASSESS', 1);
$this->getDispatcher()->dispatch(
new TriggerTaskEvent('\Xibo\XTR\MaintenanceRegularTask', 'DYNAMIC_DISPLAY_GROUP_ASSESSED'),
TriggerTaskEvent::$NAME
);
}
} else {
$this->getLog()->debug('Tags were not changed');
Expand Down
Loading
Loading