diff --git a/core/lib/Drupal/Core/Token/TokenTypeManager.php b/core/lib/Drupal/Core/Token/TokenTypeManager.php index 083e03c..03c0584 100644 --- a/core/lib/Drupal/Core/Token/TokenTypeManager.php +++ b/core/lib/Drupal/Core/Token/TokenTypeManager.php @@ -28,7 +28,7 @@ class TokenTypeManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - parent::__construct('Plugin/TokenType', $namespaces, $module_handler, 'Drupal\token\Annotation\TokenType'); + parent::__construct('Plugin/TokenType', $namespaces, $module_handler, 'Drupal\Core\Annotation\TokenType'); $this->alterInfo('token_info'); $this->setCacheBackend($cache_backend, 'token_info'); } diff --git a/core/lib/Drupal/Core/Utility/Token.php b/core/lib/Drupal/Core/Utility/Token.php index bc4d7f3..31a6759 100644 --- a/core/lib/Drupal/Core/Utility/Token.php +++ b/core/lib/Drupal/Core/Utility/Token.php @@ -258,8 +258,8 @@ public function generate($type, array $tokens, array $data = array(), array $opt $options += array('sanitize' => TRUE); // @Todo this is a temporary implementation calling the plugin. /** @var \Drupal\Core\Token\TokenTypeInterface $node_token_type */ - $node_token_type = $this->tokenTypeManager->getInstance('node_token_type'); - $replacements = $node_token_type->getTokens($type, $tokens, $data, $options); + $node_token_type = $this->tokenTypeManager->createInstance('node_token_type'); + $replacements[] = $node_token_type->getTokens($type, $tokens, $data, $options); $replacements += $this->moduleHandler->invokeAll('tokens', array($type, $tokens, $data, $options)); // Allow other modules to alter the replacements. @@ -335,7 +335,7 @@ public function getInfo() { else { // @Todo this is a temporary implementation calling the plugin. /** @var \Drupal\Core\Token\TokenTypeInterface $node_token_type */ - $node_token_type = $this->tokenTypeManager->getInstance('node_token_type'); + $node_token_type = $this->tokenTypeManager->createInstance('node_token_type'); $this->tokenInfo[] = $node_token_type->getTokenInfo(); $this->tokenInfo += $this->moduleHandler->invokeAll('token_info'); $this->moduleHandler->alter('token_info', $this->tokenInfo);