/** * {@inheritdoc} */ public function submitOptionsForm(&$form, FormStateInterface $form_state) { $content = $form_state->getValue(array('options', 'content')); $form_state->setValue(array('options', 'format'), $content['format']); $form_state->setValue(array('options', 'content'), $content['value']); parent::submitOptionsForm($form, $form_state); }
/** * {@inheritdoc} */ public function submitOptionsForm(&$form, FormStateInterface $form_state) { parent::submitOptionsForm($form, $form_state); // Load the referenced entity and store its config target identifier if // the target does not contains tokens. // @todo Use a method to check for tokens in // https://www.drupal.org/node/2396607. $options = $form_state->getValue('options'); if (strpos($options['target'], '{{') === FALSE) { if ($entity = $this->entityManager->getStorage($this->entityType)->load($options['target'])) { $options['target'] = $entity->getConfigTarget(); } $form_state->setValue('options', $options); } }
/** * {@inheritdoc} */ public function submitOptionsForm(&$form, FormStateInterface $form_state) { $form_state['values']['options']['format'] = $form_state['values']['options']['content']['format']; $form_state['values']['options']['content'] = $form_state['values']['options']['content']['value']; parent::submitOptionsForm($form, $form_state); }