diff --git a/token.module b/token.module index 1076f97..3733be6 100644 --- a/token.module +++ b/token.module @@ -326,11 +326,11 @@ function token_module_implements_alter(&$implementations, $hook) { * The token name. * * @return mixed - * The value of $info['tokens'][$type][$name]['module'] from token_get_info(), - * or NULL if the value does not exist. + * The value of $info['tokens'][$type][$name]['module'] from token info, or + * NULL if the value does not exist. */ function _token_module($type, $name) { - $token_info = token_get_info($type, $name); + $token_info = \Drupal::token()->getTokenInfo($type, $name); return isset($token_info['module']) ? $token_info['module'] : NULL; } @@ -382,7 +382,7 @@ function token_element_validate($element, FormStateInterface $form_state) { // Check if the field defines specific token types. if (isset($element['#token_types'])) { - $invalid_tokens = token_get_invalid_tokens_by_context($tokens, $element['#token_types']); + $invalid_tokens = \Drupal::token()->getInvalidTokensByContext($tokens, $element['#token_types']); if ($invalid_tokens) { $form_state->setError($element, t('The %element-title is using the following invalid tokens: @invalid-tokens.', array('%element-title' => $title, '@invalid-tokens' => implode(', ', $invalid_tokens)))); }