You are here

public function BricksTreeDynamicInlineWidget::correctBundle in Bricks​ 2.x

Same name and namespace in other branches
  1. 8 modules/bricks_dynamic/src/Plugin/Field/FieldWidget/BricksTreeDynamicInlineWidget.php \Drupal\bricks_dynamic\Plugin\Field\FieldWidget\BricksTreeDynamicInlineWidget::correctBundle()

File

modules/bricks_dynamic/src/Plugin/Field/FieldWidget/BricksTreeDynamicInlineWidget.php, line 215

Class

BricksTreeDynamicInlineWidget
Plugin annotation @FieldWidget( id = "bricks_tree_dynamic_inline", label = @Translation("Bricks tree Dynamic (Inline entity form)"), description = @Translation("A tree of inline entity forms."), field_types = { "bricks_dynamic" }, …

Namespace

Drupal\bricks_dynamic\Plugin\Field\FieldWidget

Code

public function correctBundle(array &$element, FormStateInterface $form_state) {
  if (!isset($element['#options'][$element['#value']])) {
    $form_state
      ->clearErrors();
  }
}