Closed (fixed)
Project:
Token
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2011 at 13:49 UTC
Updated:
21 Oct 2011 at 16:00 UTC
Jump to comment: Most recent file
I'm trying to think of why I had 4 set as a default. I think it was for field tokens - [node:field_name:values:0:something] would be 4 levels deep.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | token-1271966-5.patch | 618 bytes | jody lynn |
Comments
Comment #1
michelleChanging the default and making it configurable would be great. Then you have the faster loading in most cases with the ability to put up with slower loading if you really need to get at a deep token.
I'm pretty fuzzy on how tokens work... If you set it to 3 normally, then the admin sets it to 4 to get a deep one in the list, but then sets it back to 3 for normal use, will that deep one be accessible when the token is being used? In other words, does this setting affect only the admin screens or the actual usage as well?
Michelle
Comment #2
dave reidYeah this would only affect the UI and doesn't affect token replacement at all.
Comment #3
michelleSounds perfect, then. :)
Thanks!
Michelle
Comment #4
13rac1 commented+1. Setting default tree depth to 3 would correct performance problems for most use cases.
Comment #5
jody lynnYes please. That would stop my sites from blowing up.
Comment #6
berdirYes please!
Depth 4 resulted in multiple thousands of tokens (user with fields -> node with fields -> media gallery with fields -> ... + the current token/entity_tokens issue) on a site here and it killed both the site and the browser when trying to display it.
I guess an optimal solution would be to only display 2 or so and load deeper levels with ajax on the fly :)
I appled the patch and the token browser is still slow but already much better. RTBC.
Comment #7
dave reidAgreed this is a reasonable stop-gap for now. Committed #5 to Git. http://drupalcode.org/project/token.git/commit/b6766a3
Comment #8
liquidcms commentedsweeeet.. trying this now.. this sounds like it should allow the JS to finish loading on most of my admin pages.. :)
Comment #9
liquidcms commentedhmm.. well not the major improvement i thought it might be.. pages with token browser still need 1 or 2 refreshes to load completely. i set recursion depth to 2 and then i think pages were loading completely.. although maybe sporadic. at 1 it seemed faster and reliable.
but at 1 i still get tokens like this: [user:field-discipline:field_attachments] , so perhaps i don't get what depth is referring to here and i think there are still 1000's of tokens being listed. ajax loading of each category is likely the way to go here..