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

Misc 4.0.5 issues #2192

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ then
/bin/sed -i "s/^MYSQL_BACKUP_ENABLED=.*$/MYSQL_BACKUP_ENABLED=$MYSQL_BACKUP_ENABLED/" /etc/periodic/15min/cms-db-backup
/bin/sed -i "s/^MYSQL_DATABASE=.*$/MYSQL_DATABASE=$MYSQL_DATABASE/" /etc/periodic/15min/cms-db-backup

echo "*/15 * * * root /etc/periodic/15min/cms-db-backup > /dev/null 2>&1" > /etc/cron.d/cms_backup_cron
echo "*/15 * * * * root /etc/periodic/15min/cms-db-backup > /dev/null 2>&1" > /etc/cron.d/cms_backup_cron
echo "" >> /etc/cron.d/cms_backup_cron

# Update /var/www/maintenance with current environment (for cron)
Expand Down
2 changes: 1 addition & 1 deletion lib/Entity/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
}

// Delete widget history
$this->getStore()->update('DELETE FROM `widgethistory` WHERE layoutHistoryId IN (SELECT layoutHistoryId FROM `layouthistory` WHERE campaignId = :campaignId)', ['campaignId' => $this->campaignId]);

Check warning on line 1018 in lib/Entity/Layout.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 208 characters

// Delete layout history
$this->getStore()->update('DELETE FROM `layouthistory` WHERE campaignId = :campaignId', ['campaignId' => $this->campaignId]);
Expand Down Expand Up @@ -1179,7 +1179,7 @@
if (count($layoutHistoryId) <= 0) {
// We are missing the parent layout history record, which isn't good.
// I think all we can do at this stage is log it
$this->getLog()->alert('Missing Layout History for layoutId ' . $parent->layoutId . ' which is on campaignId ' . $parent->campaignId);

Check warning on line 1182 in lib/Entity/Layout.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 146 characters
return;
}

Expand Down Expand Up @@ -1652,7 +1652,7 @@

foreach ($module->properties as $property) {
// We only output properties for native rendered widgets
if ($module->renderAs === 'native') {
if ($module->renderAs === 'native' || $property->includeInXlf) {
if (($uriInjected && $property->id == 'uri') || empty($property->id)) {
// Skip any property named "uri" if we've already injected a special node for that.
// Skip properties without an id
Expand Down Expand Up @@ -2488,8 +2488,8 @@
{
$this->getLog()->debug('Adding Layout ' . $this->layout);

$sql = 'INSERT INTO layout (layout, description, userID, createdDT, modifiedDT, publishedStatusId, status, width, height, schemaVersion, backgroundImageId, backgroundColor, backgroundzIndex, parentId, enableStat, retired, duration, autoApplyTransitions, code)

Check warning on line 2491 in lib/Entity/Layout.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 268 characters
VALUES (:layout, :description, :userid, :createddt, :modifieddt, :publishedStatusId, :status, :width, :height, :schemaVersion, :backgroundImageId, :backgroundColor, :backgroundzIndex, :parentId, :enableStat, 0, 0, :autoApplyTransitions, :code)';

Check warning on line 2492 in lib/Entity/Layout.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 263 characters

$time = Carbon::now()->format(DateFormatHelper::getSystemFormat());

Expand Down
1 change: 1 addition & 0 deletions lib/Factory/ModuleXmlTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private function parseProperties($propertyNodes, ?Module $module = null): array
$property->allowLibraryRefs = $node->getAttribute('allowLibraryRefs') === 'true';
$property->allowAssetRefs = $node->getAttribute('allowAssetRefs') === 'true';
$property->parseTranslations = $node->getAttribute('parseTranslations') === 'true';
$property->includeInXlf = $node->getAttribute('includeInXlf') === 'true';
$property->title = __($this->getFirstValueOrDefaultFromXmlNode($node, 'title'));
$property->helpText = __($this->getFirstValueOrDefaultFromXmlNode($node, 'helpText'));
$property->value = $this->getFirstValueOrDefaultFromXmlNode($node, 'value');
Expand Down
3 changes: 3 additions & 0 deletions lib/Widget/Definition/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class Property implements \JsonSerializable
/** @var bool Should translations be parsed in the value? */
public $parseTranslations = false;

/** @var bool Should the prooperty be included in the XLF? */
public $includeInXlf = false;

/** @var \Xibo\Widget\Definition\PlayerCompatibility */
public $playerCompatibility;

Expand Down
19 changes: 15 additions & 4 deletions lib/Widget/Render/WidgetHtmlRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,13 @@ private function render(
if ($moduleTemplate->stencil->twig !== null) {
$twig['twig'][] = $this->twig->fetchFromString(
$this->decorateTranslations($moduleTemplate->stencil->twig),
$moduleTemplate->getPropertyValues()
$widgetData['templateProperties'],
);
}
if ($moduleTemplate->stencil->style !== null) {
$twig['style'][] = $this->twig->fetchFromString(
$moduleTemplate->stencil->style,
$widgetData['templateProperties'],
);
}
}
Expand All @@ -556,10 +562,12 @@ private function render(
// What does our module have
if ($module->stencil !== null) {
// Stencils have access to any module properties
$modulePropertyValues = $module->getPropertyValues();

if ($module->stencil->twig !== null) {
$twig['twig'][] = $this->twig->fetchFromString(
$this->decorateTranslations($module->stencil->twig),
array_merge($module->getPropertyValues(), ['settings' => $module->getSettingsForOutput()]),
array_merge($modulePropertyValues, ['settings' => $module->getSettingsForOutput()]),
);
}
if ($module->stencil->hbs !== null) {
Expand All @@ -573,11 +581,14 @@ private function render(
if ($module->stencil->head !== null) {
$twig['head'][] = $this->twig->fetchFromString(
$this->decorateTranslations($module->stencil->head),
$module->getPropertyValues()
$modulePropertyValues
);
}
if ($module->stencil->style !== null) {
$twig['style'][] = $module->stencil->style;
$twig['style'][] = $this->twig->fetchFromString(
$module->stencil->style,
$modulePropertyValues,
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/hls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</property>
</settings>
<properties>
<property id="uri" type="text" variant="uri">
<property id="uri" type="text" variant="uri" includeInXlf="true">
<title>Video Path</title>
<helpText>A URL to the HLS video stream. Requires Player running Windows 8.1 or later, or Android 6 or later. Earlier Android devices may play HLS via the LocalVideo widget.</helpText>
<rule>
Expand Down
1 change: 1 addition & 0 deletions views/displayprofile-form-edit-android.twig
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
{% set title = "Video Engine"|trans %}
{% set helpText = "Select which video engine should be used to playback video. ExoPlayer is usually better, but if you experience issues you can revert back to Android Media Player. HLS always uses ExoPlayer. Available from v3 R300."|trans %}
{% set options = [
{ id: 'default', value: "Device Default"|trans },
{ id: 'exoplayer', value: "ExoPlayer"|trans },
{ id: 'mediaplayer', value: "Android Media Player"|trans },
] %}
Expand Down
Loading