Drupal: update modul Token
This commit is contained in:
parent
491828d08a
commit
048805082c
@ -5,9 +5,8 @@ core = 7.x
|
|||||||
files[] = token_test.module
|
files[] = token_test.module
|
||||||
hidden = TRUE
|
hidden = TRUE
|
||||||
|
|
||||||
; Information added by Drupal.org packaging script on 2017-01-25
|
; Information added by Drupal.org packaging script on 2021-03-02
|
||||||
version = "7.x-1.7"
|
version = "7.x-1.8"
|
||||||
core = "7.x"
|
core = "7.x"
|
||||||
project = "token"
|
project = "token"
|
||||||
datestamp = "1485316088"
|
datestamp = "1614719852"
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
name = Token
|
name = Token
|
||||||
description = Provides a user interface for the Token API and some missing core tokens.
|
description = Provides a user interface for the Token API and some missing core tokens.
|
||||||
core = 7.x
|
core = 7.x
|
||||||
|
dependencies[] = system (>=7.23)
|
||||||
files[] = token.test
|
files[] = token.test
|
||||||
|
|
||||||
; Information added by Drupal.org packaging script on 2017-01-25
|
; Information added by Drupal.org packaging script on 2021-03-02
|
||||||
version = "7.x-1.7"
|
version = "7.x-1.8"
|
||||||
core = "7.x"
|
core = "7.x"
|
||||||
project = "token"
|
project = "token"
|
||||||
datestamp = "1485316088"
|
datestamp = "1614719852"
|
||||||
|
|
||||||
|
@ -161,6 +161,8 @@ function token_theme() {
|
|||||||
'attributes' => array(),
|
'attributes' => array(),
|
||||||
'empty' => '',
|
'empty' => '',
|
||||||
'caption' => '',
|
'caption' => '',
|
||||||
|
'colgroups' => array(),
|
||||||
|
'sticky' => TRUE,
|
||||||
),
|
),
|
||||||
'file' => 'token.pages.inc',
|
'file' => 'token.pages.inc',
|
||||||
);
|
);
|
||||||
@ -1228,7 +1230,7 @@ function token_menu_link_load_all_parents($mlid) {
|
|||||||
if (!isset($cache[$mlid])) {
|
if (!isset($cache[$mlid])) {
|
||||||
$cache[$mlid] = array();
|
$cache[$mlid] = array();
|
||||||
$plid = db_query("SELECT plid FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField();
|
$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];
|
$cache[$mlid] = array($plid => $parent['title']) + $cache[$mlid];
|
||||||
$plid = $parent['plid'];
|
$plid = $parent['plid'];
|
||||||
}
|
}
|
||||||
|
@ -956,6 +956,7 @@ class TokenArrayTestCase extends TokenTestHelper {
|
|||||||
'last' => 'b',
|
'last' => 'b',
|
||||||
'value:0' => 'a',
|
'value:0' => 'a',
|
||||||
'value:2' => 'c',
|
'value:2' => 'c',
|
||||||
|
'value:#property' => NULL,
|
||||||
'count' => 4,
|
'count' => 4,
|
||||||
'keys' => '2, 0, 4, 1',
|
'keys' => '2, 0, 4, 1',
|
||||||
'keys:value:3' => '1',
|
'keys:value:3' => '1',
|
||||||
@ -1080,7 +1081,7 @@ class TokenBlockTestCase extends TokenTestHelper {
|
|||||||
$edit['body[value]'] = 'This is the test token title block.';
|
$edit['body[value]'] = 'This is the test token title block.';
|
||||||
$this->drupalPost('admin/structure/block/add', $edit, 'Save block');
|
$this->drupalPost('admin/structure/block/add', $edit, 'Save block');
|
||||||
// Ensure token validation is working on the 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.
|
// Create the block for real now with a valid title.
|
||||||
$edit['title'] = '[current-page:title] block title';
|
$edit['title'] = '[current-page:title] block title';
|
||||||
|
@ -848,7 +848,7 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
|
|||||||
// [array:value:*] dynamic tokens.
|
// [array:value:*] dynamic tokens.
|
||||||
if ($value_tokens = token_find_with_prefix($tokens, 'value')) {
|
if ($value_tokens = token_find_with_prefix($tokens, 'value')) {
|
||||||
foreach ($value_tokens as $key => $original) {
|
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);
|
$replacements[$original] = token_render_array_value($array[$key], $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user