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,
      ];
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

Status: Active » Needs review
FileSize
504 bytes

I 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.

Berdir’s picture

There'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.

Wim Leers’s picture

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

Hrm… 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?

Dave Reid’s picture

I 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.

  • Dave Reid committed 5a36ca5 on 8.x-1.x authored by Berdir
    Issue #2541166 by tstoeckler, Berdir: Fixed token browser modal did not...
Dave Reid’s picture

Committed #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?

Berdir’s picture

Status: Fixed » Closed (fixed)

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