You are here

function paragraphs_field_widget_embed_delay_required_validation in Paragraphs 7

After-build callback to validate an individual paragraphs element.

Parameters

array $element: A form element array containing basic properties of the paragraphs element.

array $form_state: An associative array containing the current state of the form.

1 string reference to 'paragraphs_field_widget_embed_delay_required_validation'
paragraphs_field_widget_form_build in ./paragraphs.field_widget.inc
Widget form implementation for paragraphs.

File

./paragraphs.field_widget.inc, line 695
Holds functions for the paragraphs widgets.

Code

function paragraphs_field_widget_embed_delay_required_validation(array &$element, array &$form_state) {

  // If the process_input flag is set, the form and its input is going to be
  // validated. Prevent #required (sub)fields from throwing errors while
  // their non-#required paragraphs item is empty.
  if ($form_state['process_input']) {
    _paragraphs_collect_required_elements($element, $element['#paragraphs_required_elements']);
  }
  return $element;
}