I have very much modules enabled, which support Token integration
(cck_phone, date, email, entity_token, feeds, file_entity, filefield_paths, hierarchical_select, i18n_taxonomy, pathauto, title, variable, views). This means a lot of custom available tokens, too.
When editing a field (in a content type's "Manage fields" tab or in a given view), very much tokens have to be displayed on the UI in a huge, nested table tree.
This needs very much resources even on server side (mainly memory; storing tokens in a nested array, passing it between functions, using theme_table() to generate the output, etc.) and on the client side too (post-formatting with jQuery treeTable plugin).

With so much modules enabled that support Token, this can lead to out of memory errors when trying to generate the nested tables (see the attached images). I have 256 MBs (!) of memory enabled on my live server, and it runs out of memory when trying to edit field settings that support Token. When disabling Token, everything works fine.
I also tested it on localhost (with more memory enabled), copied out only the table generated by Token module from the source code, saved it in a regular text file, and its size is more than 15 MB! I don't think that's right (displaying so much data per one request).

So I suggest only outputting the titles of main groups first (like "Current date", "Current page", "Current user", "Files", "Nodes", "Random", "Site information", "Variables"), and displaying the subtables (contents in a group) on-demand (expanding the given group) with AJAX.

Is it feasible?
Thank you very much in advance!

Token groups

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sk8erPeter’s picture

Category: support » feature

Maybe it's rather a feature request.

Dave Reid’s picture

Status: Active » Closed (duplicate)

You will need modules to implement the changes required in #1684984: Support opening token browser in a jQuery UI dialog on demand to offload the token browser to a separate request. Everything else is covered by existing Performance-related issues.