This change record in Token module implies that we need to update the way that we create the token browser in Metatag module: [#2648394].

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review

Here is a patch that fixes it. You need the latest development release of token for this to work.

juampynr’s picture

juampynr’s picture

Title: Fix token tree browser theme callaback » Fix token tree browser theme callback
Berdir’s picture

+++ b/src/MetatagToken.php
@@ -67,25 +67,23 @@ class MetatagToken {
         '#token_types' => 'all',

Not directly related to this issue, but:

It's a problem that you use this in such a generic context with no way to customize it and then have to resort to token_types all. This is problematic for two reasons:

a) It will possibly display a huge amount of tokens, which will take longer to load and is more likely to crash on the server (memory) or even in the browser, until we re-design that UI.

b) It's also confusing to the user, because he might use tokens that are then not available.. e.g. node tokens on a term or the other way round.

DamienMcKenna’s picture

@juampynr: Thanks. Committed.

@berdir: I've added a new issue for your observation: #2650848: Only show appropriate tokens in the token browser

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.