Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When Automatic Nodetitles is enabled, and I go to admin/structure/types/manage/{my_content_type}, it takes >60 sec to load the page. I also have the impression it consumes a lot of memory.
Is it because the system is collecting all tokens?
In my system, auto_nodetitle vertical tab is the first in order, so I cannot test if the occurrs on 'show page' of 'show tab'
The list of tokens is not using the default 'Replacement patterns' Fieldset, which is used in many other places. Is there a reason for this difference?
Comment | File | Size | Author |
---|---|---|---|
#12 | auto_nodetitle_tokens_tree-1115324.patch | 528 bytes | sir_gon |
#6 | Screen Shot 2013-07-31 at 08.14.12.png | 28.8 KB | Szerge |
Comments
Comment #1
johnvI blame this on the token module.
Since a week the following error pops up, making contenttype edit page inaccessable:
Fatal error: Allowed memory size ... exhausted in ...\database\database.inc on line 2039
The following change removes the error and hides the node tokens, but shows that function theme_token_tree() in token.pages.inc has a caching problem:
Issue is to be resolved in #1068990: Optimize and add caching for theme_token_tree()
Comment #2
fonant CreditAttribution: fonant commentedI get this, and in my case it's caused by having node reference fields to nodes with node reference fields. The token tree thus lists field tokens for nodes that are referenced by nodes that are referenced by nodes, quickly growing out of control.
More discussion here: #1252840: Node references + Entity Tokens creates HUGE Token Tree UI table HTML
For my site I fixed the problem temporarily with http://drupal.org/project/token_tweaks and setting a maximum depth of 2 for the token tree.
Comment #3
fonant CreditAttribution: fonant commentedFor automatic_nodetitles it would be really nice if the token system could provide a tree for just the current node type, and not for all possible node types. That would speed things up quite a bit.
Or perhaps we could add hook_tokens_alter() to automatic_nodetitles to strip out tokens for node types other than the one we're editing?
Comment #4
imclean CreditAttribution: imclean commentedI'm not sure this issue has been resolved. #3 is a good suggestion. Disabling auto_nodetitle means I can actually access the Manage Content type page.
Comment #5
Szerge CreditAttribution: Szerge commentedAfter installin the module, when I try to edit a type (I can still manage the fields and displays, not the main edit), I've a fatal error, so I had to disable the module. I would like to go one step further, and desinstall it, but I can't. It's a real drag...
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2986337 bytes) in /home/web/drupal7/includes/database/database.inc on line 2168
Comment #6
Szerge CreditAttribution: Szerge commentedOne more thing, now that I have disabled the module, each time I display a block, I have this error:
Notice: Undefined variable: source_fields in ddblock_form_alter() (line 1090 of /home/web/drupal7/sites/all/modules/ddblock/ddblock.module).
Which is probably connected to the fact that I still have the mapping option visible on the block (c.f. attachment).... Not very clean...
Comment #7
Szerge CreditAttribution: Szerge commentedAnd now that I've cleared the cache, I have one more error:
Warning: Invalid argument supplied for foreach() in form_select_options() (line 2674 of /home/web/drupal7/includes/form.inc).
Comment #8
peterbkk CreditAttribution: peterbkk commentedi'm currently having this issue too, tokens slowing the page load.
Comment #9
johnvIn D7, replace this module with Automatic Entity Label, where I have no problems.
This module is not maintained. See also the project page for 'latest commit' and 'related module for D7'.
Comment #10
michaellenahan CreditAttribution: michaellenahan at erdfisch commentedI took a (ahem) 'pragmatic' approach and commented out the lines in #1 above.
I figure, I can live without the token generation help. In the event I will ever need it again, it will be when I am making a change on my local machine - in which case I can un-comment the lines again.
Comment #11
RgnYLDZ CreditAttribution: RgnYLDZ commented#10 works for me. I have finished editing the title with tokens, so I don't need the list to load every time.
BTW for those who have the same problem; the code in #10 is in modules/auto_nodetitle/auto_nodetitle.module on line 181
Comment #12
sir_gon CreditAttribution: sir_gon as a volunteer and commentedSome friend give me this better tip.
To preserve function, but avoid slow loading of all available tokens, you can change the "theme" form field formatter to:
(for current stable version, in line 181)
Please try and merge the attached patch
Comment #13
alabandit CreditAttribution: alabandit as a volunteer commentedI can confirm the #12 works for me.
Thanks very much!
Comment #14
manoloka CreditAttribution: manoloka commentedI can confirm the #12 works for me too.
Thank you very much sir_gon !
Comment #15
michaellenahan CreditAttribution: michaellenahan at erdfisch commentedRTBC. I think #12 is ready to be committed.
Comment #16
mjgruta CreditAttribution: mjgruta commentedThis has been RTBC for a year, please commit. =)
Comment #17
imclean CreditAttribution: imclean commentedThis module has had no changes in 6 years and appears to be no longer supported. Try Auto Entity Label instead.