/**
  * {@inheritdoc}
  */
 public function validateConfigurationForm(array &$form, FormStateInterface $form_state)
 {
     parent::validateConfigurationForm($form, $form_state);
     if ($form_state->isValueEmpty('width') && $form_state->isValueEmpty('height')) {
         $form_state->setErrorByName('data', $this->t('Width and height can not both be blank.'));
     }
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function validateConfigurationForm(array &$form, FormStateInterface $form_state)
 {
     parent::validateConfigurationForm($form, $form_state);
     if (empty($form_state['values']['width']) && empty($form_state['values']['height'])) {
         form_set_error('data', $form_state, $this->t('Width and height can not both be blank.'));
     }
 }