Skip to content

Commit a2e3d1c

Browse files
Merge pull request #3136 from xibosignage/release43
4.3.1 release
2 parents ff64775 + e0716e1 commit a2e3d1c

File tree

107 files changed

+934
-588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+934
-588
lines changed

.github/workflows/build-container.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ on:
55
branches:
66
- master
77
- develop
8-
- kopff
98
- release23
109
- release33
11-
- release40
10+
- release43
1211

1312
jobs:
1413
build:

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/*
3+
* Copyright (C) 2025 Xibo Signage Ltd
4+
*
5+
* Xibo - Digital Signage - https://xibosignage.com
6+
*
7+
* This file is part of Xibo.
8+
*
9+
* Xibo is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* any later version.
13+
*
14+
* Xibo is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
21+
*/
22+
23+
/**
24+
* Migrations for core-canvas module duration
25+
* @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
26+
*/
27+
28+
use Phinx\Migration\AbstractMigration;
29+
30+
class UpdateCoreCanvasDurationInModuleTableMigration extends AbstractMigration
31+
{
32+
public function change(): void
33+
{
34+
$this->execute('UPDATE `module` SET `defaultDuration` = 10 WHERE `moduleId` = :moduleId', [
35+
'moduleId' => 'core-canvas',
36+
]);
37+
}
38+
}

lib/Controller/Layout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,12 +1306,12 @@ function unretire(Request $request, Response $response, $id)
13061306
}
13071307

13081308
$layout->retired = 0;
1309+
13091310
$layout->save([
13101311
'saveLayout' => true,
13111312
'saveRegions' => false,
13121313
'saveTags' => false,
13131314
'setBuildRequired' => false,
1314-
'notify' => false
13151315
]);
13161316

13171317
// Return

lib/Controller/Library.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ public function grid(Request $request, Response $response)
572572
$libraryLocation = $this->getConfig()->getSetting('LIBRARY_LOCATION');
573573
$renderThumbnail = file_exists($libraryLocation . $media->mediaId . '_videocover.png');
574574
}
575-
575+
576576
if ($renderThumbnail) {
577577
$thumbnailUrl = $this->urlFor($request, $thumbnailRouteName, [
578578
'id' => $media->mediaId,
@@ -1838,8 +1838,10 @@ public function thumbnailPublic(Request $request, Response $response, $id): Resp
18381838

18391839
$this->getLog()->debug('thumbnailPublic: authorised for ' . $id);
18401840

1841+
$res = $this->thumbnail($request, $response, $id, true);
1842+
18411843
// Pass to the thumbnail route
1842-
return $this->thumbnail($request, $response, $id, true);
1844+
return $res->withHeader('Access-Control-Allow-Origin', '*');
18431845
}
18441846

18451847
/**

lib/Controller/Schedule.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,8 +1727,17 @@ public function edit(Request $request, Response $response, $id)
17271727
$schedule->campaignId = $this->isFullScreenSchedule($schedule->eventTypeId)
17281728
? $sanitizedParams->getInt('fullScreenCampaignId')
17291729
: $sanitizedParams->getInt('campaignId');
1730-
$schedule->displayOrder = $sanitizedParams->getInt('displayOrder', ['default' => $schedule->displayOrder]);
1731-
$schedule->isPriority = $sanitizedParams->getInt('isPriority', ['default' => $schedule->isPriority]);
1730+
1731+
// displayOrder and isPriority: if present but empty (""): set to 0
1732+
// if missing from form: keep existing value (fallback to 0 if unset)
1733+
$schedule->displayOrder = $sanitizedParams->hasParam('displayOrder')
1734+
? $sanitizedParams->getInt('displayOrder', ['default' => 0])
1735+
: ($schedule->displayOrder ?? 0);
1736+
1737+
$schedule->isPriority = $sanitizedParams->hasParam('isPriority')
1738+
? $sanitizedParams->getInt('isPriority', ['default' => 0])
1739+
: ($schedule->isPriority ?? 0);
1740+
17321741
$schedule->dayPartId = $sanitizedParams->getInt('dayPartId', ['default' => $schedule->dayPartId]);
17331742
$schedule->syncTimezone = $sanitizedParams->getCheckbox('syncTimezone');
17341743
$schedule->syncEvent = $this->isSyncEvent($schedule->eventTypeId);

lib/Controller/Settings.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,6 @@ public function update(Request $request, Response $response)
475475
$this->getConfig()->changeSetting('PHONE_HOME_DATE', $sanitizedParams->getInt('PHONE_HOME_DATE'));
476476
}
477477

478-
if ($this->getConfig()->isSettingEditable('PHONE_HOME_URL')) {
479-
$this->handleChangedSettings('PHONE_HOME_URL', $this->getConfig()->getSetting('PHONE_HOME_URL'), $sanitizedParams->getString('PHONE_HOME_URL'), $changedSettings);
480-
$this->getConfig()->changeSetting('PHONE_HOME_URL', $sanitizedParams->getString('PHONE_HOME_URL'));
481-
}
482-
483478
if ($this->getConfig()->isSettingEditable('SCHEDULE_LOOKAHEAD')) {
484479
$this->handleChangedSettings('SCHEDULE_LOOKAHEAD', $this->getConfig()->getSetting('SCHEDULE_LOOKAHEAD'), $sanitizedParams->getCheckbox('SCHEDULE_LOOKAHEAD'), $changedSettings);
485480
$this->getConfig()->changeSetting('SCHEDULE_LOOKAHEAD', $sanitizedParams->getCheckbox('SCHEDULE_LOOKAHEAD'));

lib/Controller/Widget.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,12 @@ public function editWidget(Request $request, Response $response, $id)
478478

479479
// Handle common parameters.
480480
$widget->useDuration = $params->getCheckbox('useDuration');
481-
$widget->duration = $params->getInt('duration', ['default' => $module->defaultDuration]);
481+
482+
// If we enabled useDuration, then use the provided duration
483+
$widget->duration = ($widget->useDuration == 1)
484+
? $params->getInt('duration', ['default' => $module->defaultDuration])
485+
: $module->defaultDuration;
486+
482487
$widget->setOptionValue('name', 'attrib', $params->getString('name'));
483488
$widget->setOptionValue('enableStat', 'attrib', $params->getString('enableStat'));
484489

lib/Dependencies/Factories.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* Copyright (C) 2024 Xibo Signage Ltd
3+
* Copyright (C) 2025 Xibo Signage Ltd
44
*
55
* Xibo - Digital Signage - https://xibosignage.com
66
*
@@ -73,7 +73,9 @@ public static function registerFactoriesWithDi()
7373
return $repository;
7474
},
7575
'bandwidthFactory' => function (ContainerInterface $c) {
76-
$repository = new \Xibo\Factory\BandwidthFactory();
76+
$repository = new \Xibo\Factory\BandwidthFactory(
77+
$c->get('pool'),
78+
);
7779
$repository->useBaseDependenciesService($c->get('RepositoryBaseDependenciesService'));
7880
return $repository;
7981
},

lib/Entity/Layout.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,9 +1315,6 @@ public function toXlf()
13151315
// merge regions and drawers into one array and go through it.
13161316
$allRegions = array_merge($this->regions, $this->drawers);
13171317

1318-
// Used to identify Layouts which only have Canvas with global elements
1319-
$isCanvasOnlyRegion = true;
1320-
13211318
foreach ($allRegions as $region) {
13221319
/* @var Region $region */
13231320

@@ -1379,8 +1376,7 @@ public function toXlf()
13791376
// Pull out the global widget, if we have one (we should)
13801377
if ($item->type === 'global') {
13811378
$widget = $item;
1382-
} else {
1383-
$isCanvasOnlyRegion = false;
1379+
13841380
}
13851381

13861382
// Get the highest duration.
@@ -1403,8 +1399,6 @@ public function toXlf()
14031399
$widgets = [$widget];
14041400
}
14051401
} else {
1406-
$isCanvasOnlyRegion = false;
1407-
14081402
$widgets = $region->getPlaylist()->setModuleFactory($this->moduleFactory)->expandWidgets();
14091403
}
14101404

@@ -1419,6 +1413,8 @@ public function toXlf()
14191413
}
14201414

14211415
// Work out if we have any "lead regions", those are Widgets with a duration
1416+
$maxWidgetDurationInLayout = 1;
1417+
14221418
foreach ($widgets as $widget) {
14231419
if (($widget->useDuration == 1 && $widget->type !== 'global')
14241420
|| $countWidgets > 1
@@ -1427,6 +1423,11 @@ public function toXlf()
14271423
) {
14281424
$layoutCountRegionsWithDuration++;
14291425
}
1426+
1427+
$maxWidgetDurationInLayout = Max(
1428+
($widget->useDuration == 1 ? $widget->duration : $widget->calculatedDuration),
1429+
$maxWidgetDurationInLayout
1430+
);
14301431
}
14311432

14321433
foreach ($widgets as $widget) {
@@ -1454,16 +1455,10 @@ public function toXlf()
14541455
) {
14551456
// Make sure this Widget expires immediately so that the other Regions can be the leaders when
14561457
// it comes to expiring the Layout
1457-
$widgetDuration = Widget::$widgetMinDuration;
1458-
}
1459-
1460-
// Layouts which only have Canvas with global elements
1461-
if ($region->type == 'canvas'
1462-
&& $widget->type == 'global'
1463-
&& $isCanvasOnlyRegion
1464-
) {
1465-
$widget->calculatedDuration = 10;
1466-
$widgetDuration = $widget->calculatedDuration;
1458+
// Only do this when the widget's default duration is not the max duration in layout
1459+
if ($widgetDuration < $maxWidgetDurationInLayout) {
1460+
$widgetDuration = Widget::$widgetMinDuration;
1461+
}
14671462
}
14681463

14691464
if ($region->isDrawer === 0) {
@@ -1477,7 +1472,7 @@ public function toXlf()
14771472
if ($tempCyclePlaybackAverageDuration) {
14781473
$region->duration = $region->duration + $tempCyclePlaybackAverageDuration;
14791474
} else {
1480-
$region->duration = $region->duration + $widget->calculatedDuration;
1475+
$region->duration = $region->duration + $widgetDuration;
14811476
}
14821477

14831478
// We also want to add any transition OUT duration
@@ -1516,6 +1511,7 @@ public function toXlf()
15161511
($widget->type === 'video' || $widget->type === 'audio')
15171512
&& $widget->useDuration === 0
15181513
);
1514+
15191515
$mediaNode->setAttribute('duration', ($isEndDetectVideoWidget ? 0 : $widgetDuration));
15201516
$mediaNode->setAttribute('useDuration', $widget->useDuration);
15211517
$widgetActionNode = null;

0 commit comments

Comments
 (0)