Skip to content

Commit

Permalink
Additional checks on timed rule config to get around pecularity with …
Browse files Browse the repository at this point in the history
…json_decode when the config is empty
  • Loading branch information
DorsetDigital committed Feb 23, 2021
1 parent e96caae commit 272e985
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Model/Rule/TimedRuled.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public function getFormFields()
$fromField = DatetimeField::create('FromTime', 'Start date/time')->setHTML5(true);
$toField = DatetimeField::create('ToTime', 'End date/time')->setHTML5(true);

if (isset($config['from'])) {
$fromValue = (string) $config['from'].":00";
if ((isset($config['from'])) && (!is_array($config['from']))) {
$fromValue = (string)$config['from'] . ":00";
$fromField->setValue($fromValue);
}
if (isset($config['to'])) {
$toValue = (string) $config['to'].":00";
if ((isset($config['to'])) && (!is_array($config['to']))) {
$toValue = (string)$config['to'] . ":00";
$toField->setValue($toValue);
}

Expand Down

0 comments on commit 272e985

Please sign in to comment.