From 7782d395ed662b02012c369cd3d914bb799fb4fe Mon Sep 17 00:00:00 2001 From: Nadz Mangandog <61860661+nadzpogi@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:42:24 +0800 Subject: [PATCH] Fix: Unable to save Schedule Action event due to an error (#2680) relates to xibosignage/xibo#3460 --- lib/Controller/Schedule.php | 8 ++++---- ui/src/core/xibo-calendar.js | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Controller/Schedule.php b/lib/Controller/Schedule.php index 655b448996..f59b3fe64e 100644 --- a/lib/Controller/Schedule.php +++ b/lib/Controller/Schedule.php @@ -1747,21 +1747,21 @@ public function edit(Request $request, Response $response, $id) if ($schedule->eventTypeId === \Xibo\Entity\Schedule::$ACTION_EVENT) { $schedule->actionType = $sanitizedParams->getString('actionType'); $schedule->actionTriggerCode = $sanitizedParams->getString('actionTriggerCode'); + $schedule->commandId = $sanitizedParams->getInt('commandId'); $schedule->actionLayoutCode = $sanitizedParams->getString('actionLayoutCode'); $schedule->campaignId = null; } else { $schedule->actionType = null; $schedule->actionTriggerCode = null; + $schedule->commandId = null; $schedule->actionLayoutCode = null; } - // collect commandId only on Command event - // null commandId otherwise + // collect commandId on Command event + // Retain existing commandId value otherwise if ($schedule->eventTypeId === \Xibo\Entity\Schedule::$COMMAND_EVENT) { $schedule->commandId = $sanitizedParams->getInt('commandId'); $schedule->campaignId = null; - } else { - $schedule->commandId = null; } // Set the parentCampaignId for campaign events diff --git a/ui/src/core/xibo-calendar.js b/ui/src/core/xibo-calendar.js index ef03b8cf1f..30e2bc4387 100644 --- a/ui/src/core/xibo-calendar.js +++ b/ui/src/core/xibo-calendar.js @@ -1264,6 +1264,8 @@ var processScheduleFormElements = function(el) { $('.layout-code-control').css('display', layoutCodeControl); $('.command-control').css('display', commandControlDisplay); + + break; case 'relativeTime' : if (!el.is(":visible")) { return;