Steps to repoduce
1-In "Manage form display", click on the gear to edit the duration settings (settings form)
2-enter any value or leave it like this
3-click "update"
You will get the following message:
Warning: preg_match() expects parameter 2 to be string, array given in Drupal\duration_field\Service\DurationService->checkDurationInvalid() (line 19 of modules/contrib/duration_field/src/Service/DurationService.php).
This is due to the fact that In the following code, $duration is empty
public function settingsFormValidate($element, FormStateInterface $form_state)
{
$duration = $form_state->getValue($element['#parents']);
if($error_message = $this->durationService->checkDurationInvalid($duration))
{
$form_state->setError($element, $error_message);
}
}
Drupal 8.5
granularity: Hour, Min, sec
Comments
Comment #2
jaypanComment #4
jaypanThanks for the report.