Skip to content

Commit

Permalink
Fix block label form alter
Browse files Browse the repository at this point in the history
  • Loading branch information
Berdir committed Jun 10, 2014
1 parent 3ea9d3e commit 27adef0
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions token.module
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,11 @@ function token_block_view_alter(&$data, \Drupal\block\BlockPluginInterface $bloc
/**
* Implements hook_form_FORM_ID_alter().
*/
function token_form_block_add_block_form_alter(&$form, $form_state) {
token_form_block_admin_configure_alter($form, $form_state);
}

/**
* Implements hook_form_FORM_ID_alter().
*/
function token_form_block_admin_configure_alter(&$form, $form_state) {
$form['settings']['title']['#description'] .= ' ' . t('This field supports tokens.');
function token_form_block_form_alter(&$form, &$form_state) {
$form['settings']['label']['#description'] = t('This field supports tokens.');
// @todo Figure out why this token validation does not seem to be working here.
$form['settings']['title']['#element_validate'][] = 'token_element_validate';
$form['settings']['title'] += array('#token_types' => array());
$form['settings']['label']['#element_validate'][] = 'token_element_validate';
$form['settings']['label'] += array('#token_types' => array());
}

/**
Expand Down

0 comments on commit 27adef0

Please sign in to comment.