Skip to content

Commit

Permalink
ScheduleElement: Don't autosubmit start when using NO_REPEAT freq
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab authored and nilmerg committed Apr 11, 2023
1 parent a4581be commit 7c7ca7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/FormElement/ScheduleElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function hasCronExpression(): bool
*/
public function getFrequency(): string
{
return $this->getValue('frequency', $this->frequency);
return $this->getPopulatedValue('frequency', $this->frequency);
}

/**
Expand Down Expand Up @@ -396,8 +396,9 @@ protected function assemble()
}
$this->setStart($start);

$autosubmit = ! $this->hasCronExpression() && $this->getFrequency() !== static::NO_REPEAT;
$this->addElement('localDateTime', 'start', [
'class' => ! $this->hasCronExpression() ? 'autosubmit' : null,
'class' => $autosubmit ? 'autosubmit' : null,
'required' => true,
'label' => $this->translate('Start'),
'value' => $start,
Expand Down Expand Up @@ -590,7 +591,6 @@ public function prepareMultipartUpdate(RequestInterface $request): array
$partUpdates = [];
if (
$autoSubmittedBy
&& ! $this->hasCronExpression()
&& (
preg_match('/\[(start|end)]$/', $autoSubmittedBy[0], $matches)
|| preg_match($pattern, $autoSubmittedBy[0])
Expand Down

0 comments on commit 7c7ca7e

Please sign in to comment.