Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As title says, I see the throbber, but the modal window is not shown and I cannot select tokens.
if (\Drupal::moduleHandler()->moduleExists('token')) {
$form['google_analytics_custom_dimension']['google_analytics_token_tree'] = [
'#theme' => 'token_tree',
'#token_types' => ['node'],
'#dialog' => TRUE,
];
}
Comment | File | Size | Author |
---|---|---|---|
#2 | 2541166-2-token-browser.patch | 1.05 KB | Berdir |
#1 | 2541166-1-token-browser.patch | 504 bytes | tstoeckler |
Comments
Comment #1
tstoecklerI had the same problem when testing the module browser at
/admin/config/people/accounts
to put some tokens in the user emails.This fixed the problem.
Comment #2
BerdirThere's a second problem now, the csrf access token fails. The reason is that it is now a placeholder and that doesn't bubble up because we call \Drupal::l() in a theme function (not sure if that part is related).
@dawehner told me to do this.
Comment #3
Wim LeersHrm… do we need a core issue to figure out a solution to this? Or is this sufficiently rare, that the solution in #2 is acceptable?
Comment #4
Dave ReidI know that calling l() will be a pattern we see quite often in contrib (or in site implementations). So it would be better to have something that everyone could use.
Comment #6
Dave ReidCommitted #2 to 8.x-1.x in the meantime. But leaving as needs review in the mean time, maybe pending a core DX issue being open?
Comment #7
BerdirThanks!
Opened #2575519: Twig template variables containing result of Drupal::url() and Drupal:l:() don't bubble up their cacheability and attachment metadata (e.g. token placeholder), closing this for now.