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

DuneBL created an issue. See original summary.

jaypan’s picture

Assigned: Unassigned » jaypan

  • Jaypan committed aa0d167 on 8.x-1.x
    Issue #2931560 by DuneBL, Jaypan: Could not edit the settingsform due to...
jaypan’s picture

Status: Active » Fixed

Thanks for the report.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.