Commit 45651b02 authored by jeanfei's avatar jeanfei Committed by guschilds

Issue #2584945 by jeanfei: Use setError instead of setErrorByName in...

Issue #2584945 by jeanfei: Use setError instead of setErrorByName in YouTubeDefaultWidget validation
parent 4eb48ec6
......@@ -107,8 +107,7 @@ class YouTubeDefaultWidget extends WidgetBase {
$form_state->setValueForElement($video_id_element, $video_id);
}
elseif (!empty($input)) {
$message = t('Please provide a valid YouTube URL.');
$form_state->setErrorByName($element['#parents'][$element['#delta']], $message);
$form_state->setError($element, t('Please provide a valid YouTube URL.'));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment