You are here

protected function EntityBrowserForm::isFunctionalForm in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Form/EntityBrowserForm.php \Drupal\entity_browser\Form\EntityBrowserForm::isFunctionalForm()

Check if entity browser with selected configuration combination can work.

1 call to EntityBrowserForm::isFunctionalForm()
EntityBrowserForm::buildForm in src/Form/EntityBrowserForm.php
Form constructor.

File

src/Form/EntityBrowserForm.php, line 203

Class

EntityBrowserForm
The entity browser form.

Namespace

Drupal\entity_browser\Form

Code

protected function isFunctionalForm() {

  /** @var \Drupal\entity_browser\WidgetInterface $widget */
  foreach ($this->entityBrowser
    ->getWidgets() as $widget) {

    /** @var \Drupal\entity_browser\SelectionDisplayInterface $selectionDisplay */
    $selectionDisplay = $this->entityBrowser
      ->getSelectionDisplay();
    if ($widget
      ->requiresJsCommands() && !$selectionDisplay
      ->supportsJsCommands()) {
      throw new ConfigException('Used entity browser selection display cannot work in combination with settings defined for used selection widget.');
    }
  }
}