This can be found in D6:

/**
 * Deprecated. Use token_element_validate() instead.
 */
function token_element_validate_token_context(&$element, &$form_state) {
  return token_element_validate($element, $form_state);
}

And this is the D7 reality:

 * $form['my_node_text_element'] = array(
 *   '#type' => 'textfield',
 *   '#title' => t('Some text to token-ize that has a node context.'),
 *   '#default_value' => 'The title of this node is [node:title].',
 *   '#element_validate' => array('token_element_validate_token_context'),
 *   '#token_types' => array('node'),
 * );

Now - what is deprecated and what not!?

Comments

Dave Reid’s picture

Status: Active » Fixed

token_element_validate_token_context() is deprecated everywhere. token_element_validate() should always be used, as is reflected in both 6.x-1.x and 7.x-1.x documentation.

Dave Reid’s picture

Also make sure you're actually using latest token code when filing issues...

hass’s picture

Status: Fixed » Active
; Information added by drupal.org packaging script on 2010-12-15
version = "6.x-1.x-dev"
core = "6.x"
project = "token"
datestamp = "1292372764"
; Information added by drupal.org packaging script on 2010-12-18
version = "7.x-1.x-dev"
core = "7.x"
project = "token"
datestamp = "1292675134"

There are no newer versions... I have installed both DEVs tonight!

hass’s picture

Status: Active » Fixed

hell, it is fixed... must have been tooooo late tonight.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.