Skip to content

Commit

Permalink
Fix: Unable to save Schedule Action event due to an error (#2680)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadzpogi authored Aug 7, 2024
1 parent 94fadcc commit 7782d39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Controller/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ui/src/core/xibo-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7782d39

Please sign in to comment.