I get this error:

Uncaught TypeError: Object [object Object] has no method 'treeTable'

The token dialog renders, but the table inside it is (of course) extremely tall, containing all of the available tokens, and there are no links to copy/paste tokens.

#11 token-2023423-11.patch3.5 KBDmitriy.trt
PASSED: [[SimpleTest]]: [MySQL] 347 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


pjcdawkins’s picture

I attempted to fix this by adding:

  drupal_add_library('token', 'treeTable');

inside theme_token_tree_link().

Then the first level of the tree renders properly, but on clicking to expand a single row, I get the error:

Uncaught TypeError: Cannot read property 'childPrefix' of undefined

chekka’s picture

same, same!

pjcdawkins’s picture

Category: support » bug

Since it's a JavaScript error I wonder if this is something to do with jQuery Update (the site is running jQuery 1.8 and jQuery UI 1.10.2).

pjcdawkins’s picture

Issue summary: View changes

Removed misleading statement

SocialNicheGuru’s picture

i am on jquery ui 1.7 and jquery 1.10 and get the same error.

DamienMcKenna’s picture

Title: Token list not made into tree table when loaded via AJAX / dialog » Token list not made into tree table when loaded via dialog
Issue summary: View changes

Clarifying that this is related to the new popup dialog interface that was added to Token recently which is still not supported by many modules.

Out of interest, what module were you opening up the dialog for? Do you know what type of object it was loading tokens for, e.g. a node, a term, a user, global?

Dave Reid’s picture

Category: Bug report » Support request

Until we can narrow this down to what is causing it, moving to a support request.

jhoffmcd’s picture

Any news on this? I just got this error trying to use tokens with File (Field) Paths.

kevinquillen’s picture

This is still happening.. I added the patch that adds current page entity context object as tokens. Now, the token dialog browser just breaks with that js error. The older method, where it isn't a dialog and is just a collapsed field element under "Replacement patterns", works.

ram4nd’s picture

Any news on this? I just got this error trying to use tokens with File (Field) Paths. And adminimal theme, latest jquery.

Liam Morland’s picture

We were using jQuery from the Google CDN and had this problem. We turned off the CDN and the problem was gone.

Dmitriy.trt’s picture

Category: Support request » Bug report
Status: Active » Needs review
3.5 KB
PASSED: [[SimpleTest]]: [MySQL] 347 pass(es). View

Experienced the same issue. It's because of the way token dialog delivers HTML, CSS & JS for the dialog. Drupal provides proper way for it, so we don't have to print CSS/JS inside the document body, hack the theme, etc. Patch attached.

sylus’s picture

The latest attached patch fixed a lot of problems I was having with Tokens and the jQuery ui dialog. Additionally I really like how it leverages drupal native ajax handling.

philsward’s picture

#10 worked for me. Using jquery_update where backend is set to Drupal default and frontend set to 1.9.

Looks like the issue comes down to the CDN. I was using Google and didn't test against the others.

joseph.olstad’s picture

+1 for patch 11