This question is from code in uc_domain_access (Ubercart Domain Access)
There are these two token statements below in that module being ported to Drupal 7 that no one supports any longer in which the functions called have been replaced - but I do not know how to reformulate the code to the new functions
At my line 168 of the module is this one below which is part of a function that Implements hook_token_values() in D6 - returns an array => $values. (hook token values => http://www.drupalcontrib.org/api/drupal/contributions!token!token.api.ph... )
foreach (uc_store_token_values('global') as $token => $value) {
$values['order-' . $token] = $value;
}
AND at line 350
foreach (uc_store_token_values('global') as $token => $value) {
$vars[str_replace('-', '_', $token)] = $value;
}
The function "uc_store_token_values" is gone in D7 (http://www.drupalcontrib.org/api/drupal/contributions!ubercart!uc_store!... )
and in Drupal 7 is is NOW "uc_store_tokens" ( http://api.ubercart.me/api/drupal/ubercart!uc_store!uc_store.tokens.inc/... )
AND the switch case token $type 'global' no longer exists - the new switch case is (would be) 'store' it appears, and returns an array now called $replacements - which otherwise is largely the same as the array $values
hook_token_values() in D6 is also gone ( http://www.drupalcontrib.org/api/drupal/contributions!token!token.api.ph... ) and is NOW hook_tokens() in D7 ( https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... )
I am not familiar with tokens. See also https://www.drupal.org/documentation/modules/token/update/6/7 and
so if I change uc_store_token_values to uc_store_tokens and 'global' to 'store' - the error is " Missing argument 2 for uc_store_tokens(), called in . . . module on line 342 and defined in uc_store_tokens() (line 72 of . . . /uc_store.tokens.inc) which is => function uc_store_tokens($type, $tokens, $data = array(), $options = array()) {
(the entire function => http://www.drupalcontrib.org/api/drupal/contributions!ubercart!uc_store!... )
So it appears argument 2 is "$tokens" of which there was no argument 2 and did not exist in uc_store_token_values (http://www.drupalcontrib.org/api/drupal/contributions!ubercart!uc_store!... ) . . .
. . . and is apparently supposed to be an/the array of tokens to be replaced according to ( https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... )
I guess the question is does anyone here know how are the two pieces of code above from 168 and 350 changed to comply with the new uc_store_tokens() function ?
Comments
The hooks for providing tokens have been renamed
It has been now discovered by digging => "The hooks for providing tokens have been renamed. hook_token_list() is now hook_token_info(), and hook_token_values() is now hook_tokens(). Both hooks also have changed parameters and different return values than their D6 equivalents." THIS FROM => https://www.drupal.org/documentation/modules/token/update/6/7
It then also says "There is currently no upgrade path between the old token names in Drupal 6 and the new chainable-style tokens in Drupal 7. Some helper functions are being written in token.module."
Clearly then the module functions must be modified and some sample code can be found at http://drupal.stackexchange.com/questions/4930/how-to-programmatically-c... and http://drupal.stackexchange.com/questions/86136/formatting-output-of-token and at drupal.org in the function token_info documentation
Usually correcting the function involved and function calls to the new hooks and / or variables affected fixes the issues.
Drupal is a doacracy (do it yourself democracy - a.k.a webchick's credited call) - if you read the code of the affected module and as I laid out as to issues above . . . you can fix token issue errors.
Question self-answered and issue fixed.