Drupal: update modul Token

This commit is contained in:
Robert 2021-03-06 20:10:18 +01:00
parent 491828d08a
commit 048805082c
5 changed files with 13 additions and 11 deletions

View File

@ -5,9 +5,8 @@ core = 7.x
files[] = token_test.module
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-01-25
version = "7.x-1.7"
; Information added by Drupal.org packaging script on 2021-03-02
version = "7.x-1.8"
core = "7.x"
project = "token"
datestamp = "1485316088"
datestamp = "1614719852"

View File

@ -1,11 +1,11 @@
name = Token
description = Provides a user interface for the Token API and some missing core tokens.
core = 7.x
dependencies[] = system (>=7.23)
files[] = token.test
; Information added by Drupal.org packaging script on 2017-01-25
version = "7.x-1.7"
; Information added by Drupal.org packaging script on 2021-03-02
version = "7.x-1.8"
core = "7.x"
project = "token"
datestamp = "1485316088"
datestamp = "1614719852"

View File

@ -161,6 +161,8 @@ function token_theme() {
'attributes' => array(),
'empty' => '',
'caption' => '',
'colgroups' => array(),
'sticky' => TRUE,
),
'file' => 'token.pages.inc',
);
@ -1228,7 +1230,7 @@ function token_menu_link_load_all_parents($mlid) {
if (!isset($cache[$mlid])) {
$cache[$mlid] = array();
$plid = db_query("SELECT plid FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField();
while ($plid && $parent = token_menu_link_load($plid)) {
while ($plid && $plid != $mlid && $parent = token_menu_link_load($plid)) {
$cache[$mlid] = array($plid => $parent['title']) + $cache[$mlid];
$plid = $parent['plid'];
}

View File

@ -956,6 +956,7 @@ class TokenArrayTestCase extends TokenTestHelper {
'last' => 'b',
'value:0' => 'a',
'value:2' => 'c',
'value:#property' => NULL,
'count' => 4,
'keys' => '2, 0, 4, 1',
'keys:value:3' => '1',
@ -1080,7 +1081,7 @@ class TokenBlockTestCase extends TokenTestHelper {
$edit['body[value]'] = 'This is the test token title block.';
$this->drupalPost('admin/structure/block/add', $edit, 'Save block');
// Ensure token validation is working on the block.
$this->assertText('The Block title is using the following invalid tokens: [user:name].');
$this->assertText('Block title is using the following invalid tokens: [user:name].');
// Create the block for real now with a valid title.
$edit['title'] = '[current-page:title] block title';

View File

@ -848,7 +848,7 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
// [array:value:*] dynamic tokens.
if ($value_tokens = token_find_with_prefix($tokens, 'value')) {
foreach ($value_tokens as $key => $original) {
if ($key[0] !== '#' && isset($array[$key])) {
if (array_key_exists($key, $array) && in_array($key, $keys)) {
$replacements[$original] = token_render_array_value($array[$key], $options);
}
}