/** * {@inheritdoc} */ public function validateForm(array &$form, array &$form_state) { // The image effect configuration is stored in the 'data' key in the form, // pass that through for validation. $effect_data = array('values' => &$form_state['values']['data']); $this->imageEffect->validateConfigurationForm($form, $effect_data); }
/** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { // The image effect configuration is stored in the 'data' key in the form, // pass that through for validation. $effect_data = (new FormState())->setValues($form_state->getValue('data')); $this->imageEffect->validateConfigurationForm($form, $effect_data); // Update the original form values. $form_state->setValue('data', $effect_data->getValues()); }
/** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { // The image effect configuration is stored in the 'data' key in the form, // pass that through for validation. $effect_data = new FormState(array('values' => $form_state['values']['data'])); $this->imageEffect->validateConfigurationForm($form, $effect_data); // Update the original form values. $form_state['values']['data'] = $effect_data['values']; }
/** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { // The image effect configuration is stored in the 'data' key in the form, // pass that through for validation. $this->imageEffect->validateConfigurationForm($form['data'], SubformState::createForSubform($form['data'], $form, $form_state)); }