Skip to content
Snippets Groups Projects
Commit 44c9c2cf authored by dpi's avatar dpi
Browse files

Fixed error when current time condition form is empty.

Fixed #87
parent 8c34f52a
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,12 @@ class CurrentTime extends ConditionPluginBase {
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
$this->configuration['date'] = $form_state->getValue('date')->format('U');
if ($date = $form_state->getValue('date')) {
$this->configuration['date'] = $date->format('U');
}
else {
$this->configuration['date'] = NULL;
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment