Would you consider this?

It sets a code based limit that allows users to disable or reduce the recursion limit of the token help tree.

We have already set the limit to 3 globally for token trees, which is the default now, see #1271966: Consider decreasing the default tree depth from 4 to 3, but this still generates a 2MB Token help tree since we have 50 content types and 100's of fields. So the result is terrible performance on the display settings page, two to three time out javascript alerts per settings edit.

This is the reason that I have marked this as a bug rather than a feature request.

If #1555856: File Token support, gets committed, this will need re-rolling to insert the file token.

Cheers

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alan D.’s picture

FileSize
1.38 KB

Note that this is a code only solution, no UI to confuse users :)

Alan D.’s picture

Trying to tempt you for following up.

AJAX post is 5.5 MB for the display settings and using FF I get this alert between 3 and 5 times with 4 to 6 second delays in-between. During the time from when the AJAX request is received and the final alert, the browser window is completely frozen.

frjo’s picture

FileSize
959 bytes

Can you test this patch? It's only minor changes I believe.

frjo’s picture

@Alan D, if you can test my patch and confirm that it works I will commit it right away.

Alan D.’s picture

sorry, missed this.

We have been running with this for a while now, and no issues. Then again, we have completely themed the token tree to only show in a popup. Webform 4.x was the last straw. It had 3 themed token trees on the page and rendering these was a real nightmare.

I wish we didn't need Entity Tokens .....

To be compatible with Token tweaks maybe this?

$recursion_limit = min(variable_get('token_tree_recursion_limit', 4), variable_get('colorbox_token_recursion_limit', 3));
frjo’s picture

Category: bug » feature
Status: Needs review » Fixed

Committed to 7-dev. Thanks for the patch!

Status: Fixed » Closed (fixed)

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

AaronBauman’s picture

Status: Closed (fixed) » Needs review
FileSize
1.03 KB

I'm re-opening an old issue because as of Token 7.x-1.3, token supports a modal dialog for the token list, rather than loading everything inline.
Is this a more appropriate solution to the same problem?

see #1684984: Support opening token browser in a jQuery UI dialog on demand

Jorrit’s picture

Patch #8 works fine, thanks.

frjo’s picture

Status: Needs review » Fixed

I have committed token dialog support but I did not remove the support for recursion limit. The need for it may be less with the dialog support but no harm in keeping it for does who need it.

Status: Fixed » Closed (fixed)

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

FiNeX’s picture

Status: Closed (fixed) » Active

@frjo: in which branch did you committed the patch? I've tested both 1.x-dev and 2.x-dev but the dialog support is not available (I've had to manually patch latest 1.x-dev version).

frjo’s picture

Assigned: Unassigned » frjo
Status: Active » Fixed

@FiNeX: It was only committed to 7.x-2.x but now I have committed it to 7.x-1.x as well. Thanks for the heads up.

FiNeX’s picture

Thanks frjo :-)

Status: Fixed » Closed (fixed)

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