From 048805082c5ee1072095bdbd481a69ecb03eae5a Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 6 Mar 2021 20:10:18 +0100 Subject: [PATCH] Drupal: update modul Token --- .../drupal/sites/all/modules/token/tests/token_test.info | 7 +++---- frontend/drupal/sites/all/modules/token/token.info | 8 ++++---- frontend/drupal/sites/all/modules/token/token.module | 4 +++- frontend/drupal/sites/all/modules/token/token.test | 3 ++- frontend/drupal/sites/all/modules/token/token.tokens.inc | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/frontend/drupal/sites/all/modules/token/tests/token_test.info b/frontend/drupal/sites/all/modules/token/tests/token_test.info index 02d937940..01926af1c 100644 --- a/frontend/drupal/sites/all/modules/token/tests/token_test.info +++ b/frontend/drupal/sites/all/modules/token/tests/token_test.info @@ -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" diff --git a/frontend/drupal/sites/all/modules/token/token.info b/frontend/drupal/sites/all/modules/token/token.info index afa8c62e9..a6176b026 100644 --- a/frontend/drupal/sites/all/modules/token/token.info +++ b/frontend/drupal/sites/all/modules/token/token.info @@ -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" diff --git a/frontend/drupal/sites/all/modules/token/token.module b/frontend/drupal/sites/all/modules/token/token.module index bbca2aab6..6d8babead 100644 --- a/frontend/drupal/sites/all/modules/token/token.module +++ b/frontend/drupal/sites/all/modules/token/token.module @@ -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']; } diff --git a/frontend/drupal/sites/all/modules/token/token.test b/frontend/drupal/sites/all/modules/token/token.test index cd09e15bd..15c406b95 100644 --- a/frontend/drupal/sites/all/modules/token/token.test +++ b/frontend/drupal/sites/all/modules/token/token.test @@ -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'; diff --git a/frontend/drupal/sites/all/modules/token/token.tokens.inc b/frontend/drupal/sites/all/modules/token/token.tokens.inc index f584bdaf2..3d65d6eea 100644 --- a/frontend/drupal/sites/all/modules/token/token.tokens.inc +++ b/frontend/drupal/sites/all/modules/token/token.tokens.inc @@ -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); } }