Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Dave Reidtoken_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.
Comment #2
Dave ReidAlso make sure you're actually using latest token code when filing issues...
Comment #3
hass CreditAttribution: hass commentedThere are no newer versions... I have installed both DEVs tonight!
Comment #4
hass CreditAttribution: hass commentedhell, it is fixed... must have been tooooo late tonight.