diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index c393b2e..06771ab 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -801,7 +801,7 @@ function document_self_tokens(&$tokens) { } } - function add_self_tokens(&$tokens, $item) { + protected function addSelfTokens(&$tokens, $item) { $field = $this->field_info; foreach ($field['columns'] as $id => $column) { // Use filter_xss_admin because it's user data and we can't be sure it is safe. diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/TaxonomyIndexTid.php index 44faa7f..28d2b98 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/TaxonomyIndexTid.php @@ -141,7 +141,7 @@ function document_self_tokens(&$tokens) { $tokens['[' . $this->options['id'] . '-vocabulary' . ']'] = t('The name for the vocabulary the term belongs to.'); } - function add_self_tokens(&$tokens, $item) { + protected function addSelfTokens(&$tokens, $item) { foreach (array('tid', 'name', 'vocabulary_vid', 'vocabulary') as $token) { // Replace _ with - for the vocabulary vid. $tokens['[' . $this->options['id'] . '-' . str_replace('_', '-', $token) . ']'] = isset($item[$token]) ? $item[$token] : ''; diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php index 7aa22fe..a14f625 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php @@ -80,7 +80,7 @@ function document_self_tokens(&$tokens) { $tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.'); } - function add_self_tokens(&$tokens, $item) { + protected function addSelfTokens(&$tokens, $item) { $tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role']; $tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid']; } diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php index 64480b5..4fa6811 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php @@ -76,7 +76,7 @@ function document_self_tokens(&$tokens) { $tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role machine-name of the role.'); } - function add_self_tokens(&$tokens, $item) { + protected function addSelfTokens(&$tokens, $item) { if (!empty($item['role'])) { $tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role']; $tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid']; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index bc8dfff..effe7da 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -1497,7 +1497,7 @@ function get_render_tokens($item) { $this->view->style_plugin->render_tokens[$this->view->row_index] = $tokens; $this->last_tokens = $tokens; if (!empty($item)) { - $this->add_self_tokens($tokens, $item); + $this->addSelfTokens($tokens, $item); } return $tokens; @@ -1572,12 +1572,12 @@ function get_token_values_recursive(array $array, array $parent_keys = array()) * where token is the field ID and subtoken is the field. If the * field ID is terms, then the tokens might be [terms-tid] and [terms-name]. */ - function add_self_tokens(&$tokens, $item) { } + protected function addSelfTokens(&$tokens, $item) { } /** * Document any special tokens this field might use for itself. * - * @see add_self_tokens() + * @see addSelfTokens() */ function document_self_tokens(&$tokens) { } diff --git a/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/field/FieldTest.php b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/field/FieldTest.php index 14f856e..9108376 100644 --- a/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/field/FieldTest.php +++ b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/field/FieldTest.php @@ -43,9 +43,9 @@ public function getTestValue() { } /** - * Overrides Drupal\views\Plugin\views\field\FieldPluginBase::add_self_tokens(). + * Overrides Drupal\views\Plugin\views\field\FieldPluginBase::addSelfTokens(). */ - function add_self_tokens(&$tokens, $item) { + protected function addSelfTokens(&$tokens, $item) { $tokens['[test-token]'] = $this->getTestValue(); }