1 block.text.inc BlockText::formValidate($form, &$form_state)

Validates the form settings.

Overrides Block::formValidate

File

core/modules/layout/includes/block.text.inc, line 128

Class

BlockText
BlockText extends Block

Code

function formValidate($form, &$form_state) {
  parent::formValidate($form, $form_state);

  if (module_exists('block')) {
    $label = trim($form_state['values']['label']);
    $delta = trim($form_state['values']['delta']);
    if ($form_state['values']['reusable']) {
      if (empty($label)) {
        form_error($form['convert']['label'], t('Admin label is required when making a block reusable.'));
      }
      elseif (empty($delta)) {
        form_error($form['convert']['delta'], t('An internal name is required when making a block reusable.'));
      }
    }
  }
}