public function ParagraphsGridLayoutPlugin::validateConfigurationForm

Overrides ParagraphsBehaviorBase::validateConfigurationForm

File

paragraphs_collection/src/Plugin/paragraphs/Behavior/ParagraphsGridLayoutPlugin.php, line 144

Class

ParagraphsGridLayoutPlugin
Provides a way to define grid based layouts.

Namespace

Drupal\paragraphs_collection\Plugin\paragraphs\Behavior

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('paragraph_reference_field')) {
    $form_state
      ->setErrorByName('message', $this
      ->t('The grid layout plugin cannot be enabled if the paragraph reference field is missing.'));
  }
  if (!$form_state
    ->getValue('available_grid_layouts')) {
    $form_state
      ->setErrorByName('message', $this
      ->t('The grid layout plugin cannot be enabled if no layouts are selected.'));
  }
}