public function ContentEntitySourcePluginUi::overviewFormValidate

Overrides SourcePluginUiBase::overviewFormValidate

File

sources/content/src/ContentEntitySourcePluginUi.php, line 261

Class

ContentEntitySourcePluginUi
Content entity source plugin UI.

Namespace

Drupal\tmgmt_content

Code

public function overviewFormValidate(array $form, FormStateInterface $form_state, $type) {
  $target_language = $form_state
    ->getValue(array(
    'search',
    'target_language',
  ));
  if (!empty($target_language) && $form_state
    ->getValue(array(
    'search',
    'langcode',
  )) == $target_language) {
    $form_state
      ->setErrorByName('search[target_language]', $this
      ->t('The source and target languages must not be the same.'));
  }
}