Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function submitConfigurationForm(array &$form, FormStateInterface $form_state)
 {
     if ($form_state->getValue('aircraft_type') === 'helicopters') {
         drupal_set_message($this->t('Helicopters are just rotorcraft.'), 'warning');
         $form_state->setValue('aircraft_type', 'rotorcraft');
     }
     parent::submitConfigurationForm($form, $form_state);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function submitConfigurationForm(array &$form, FormStateInterface $form_state)
 {
     // Filter down the bundles and allowed Entity Embed Display plugins.
     $bundles = $form_state->getValue('bundles');
     $form_state->setValue('bundles', array_keys(array_filter($bundles)));
     $display_plugins = $form_state->getValue('display_plugins');
     $form_state->setValue('display_plugins', array_keys(array_filter($display_plugins)));
     $entity_browser = $form_state->getValue('entity_browser') == '_none' ? '' : $form_state->getValue('entity_browser');
     $form_state->setValue('entity_browser', $entity_browser);
     $form_state->setValue('entity_browser_settings', $form_state->getValue('entity_browser_settings'));
     parent::submitConfigurationForm($form, $form_state);
 }