When using cck and creating a content type with atleast one cck field, like text. The following error occurs when trying to create a template:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 162022 bytes) in C:\xampp\htdocs\drupal\sites\default\modules\contemplate\contemplate.module on line 675
Note, the content type has to have atleast one node active for the error to occur. The system referenced above is a clean 6.1 install with just cck (content + text) and contemplate installed. I had the same error with the previous versions of cck and contemplate the last two weeks.
Same error on another site running off a server, with more modules activated.
Comments
Comment #1
jrglasgow commentedCCK fields are causing problems, they are added into the original node array as
$array['field_*']=>array();and they are also added into$array['content']['field_*']=>array()this array has not only the information for the CCK field, but also information for the whole node, even itself, recursively, this leads to memory issues while traversing the array recursively. I just committed a fix that removes the CCK field from thenode['content']array to avoid duplication. This won't affect the actual node variables, just those that are displayed in the "* Variables" drop down box. My changes will appear in the next release. 6.x-0.4-2Comment #2
lurkerfilms commentedThis still seems to occur even with 6.x-0.4-2.
A defensive programming technique would be to keep track of objects you have already visited during a traversal. Doing this will prevent future problems if cycles occur in the graph.
Comment #3
jrglasgow commentedComment #4
kreynen commentedI was having this issue even with the most recent version of the module until I update to the most recent version of CCK as well.
Comment #5
kreynen commentedSpoke too soon. The error is back.
Updated: The error was temporarily eliminated because updating CCK forced me to re-enable the CCK field types modules like Text and Number. I can have the main Content module enabled, but as soon as I enable a single content type module Contemplate throws the Fatal error: Allowed memory size of... error.
Comment #6
youngbuddha commentedI am facing this same problem, and since it is affects basic functionality of Contemplate, I am taking the liberty to upgrade it to "critical".
Thank you for your time and effort.
Comment #7
Fayna commentedI am still having this problem also. :( Have the latest versions of CCK and Contemplate as of today, and whenever I try to create a template for content types with nodes in them, it's a blank page with the PHP memory error.
Comment #8
jrglasgow commentedThe port of CCK to D6 went Alpha last Thursday, April 24. I am hoping to have some time this week (April 27th to May 3rd) to work on this issue. I will post back when I have some results. If anyone wants to offer any suggestions, patches it is always weclome.
Comment #9
teebo commentedHi,
I'm also having an error in the same function:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 274655 bytes) in /Library/WebServer/Documents/Drupal6/sites/all/modules/contemplate/contemplate.module on line 699
It occurs when I try to create a contemplate to a content type that already has nodes.
Do not know why.
Comment #10
teebo commentedI'm avoiding the error by simply removing (quoting) the following in the contemplate_array_variables function:
if (isset($array['content'])) {
foreach ($array['content'] as $key => $value) {
//if (strpos($key, 'field_') === 0) {
unset($array['content'][$key]);
//}
}
}
Definitively a TEMPORARY fix.
Comment #11
jallenb commentedThanks teebo for the workaround. Looking forward to the patch.
Comment #12
bbinkovitz commentedI'm having this problem as well. Each time I increase the allowed memory, it gobbles up more. I'm using the most recent stable CCK release. ConTemplate enables just fine in the modules page and then stalls the whole site when I try to create a content template.
Comment #13
bbinkovitz commentedThat temporary fix worked for me too. Thanks!
Comment #14
jrglasgow commentedCan everyone test 6.x-0.9 and see if this fixes it. It worked on my test box, hopefully this will take care of it. Of course I only had a couple of fields, and not much of a body.
Comment #15
rru commentedI got the error today using 6.x-0.9 on a content type comprising 13 fields. The temporary fix mentioned above by teebo seems to work, i.e. in the function contemplate_array_variables I use the statement
unset($array['content'][$key]);
instead of the if-construct
if ((strpos($key, 'field_') === 0) && (isset($array['content'][$key]['#node']))) {
unset($array['content'][$key]['#node']);
}
Comment #16
jrglasgow commentedThe problem with unsetting
$array['content'][$key]is you remove all items from$array['content'], this could potentially remove some data the user may need. The newest release 6.x-0.10 will remove more items from$array['content']without removing it all. If this problem still persists I will add an option to remove all the items from$array['content']in the next release.Comment #17
Anonymous (not verified) commentedJust installed 6.x-0.10 and have the same error others have reported here with out of memory. Contemplate works fine for all content types except those few I've created using CCK that have a number of additional fields.
Comment #18
jrglasgow commentedI have implemented a new option in the code, there is now an option to completely remove
$node->contentfrom the variables list. Since this seems to be a big problem the option is enabled by default. These variables in the$node->contentarray will still be available to use in the content template, but they are causing PHP to go over memory limits when displaying them in the variable list when used with many CCK fields. These changes have been implemented in 6.x-0.11, if you all could test to find any problems, I would appreciate it. Thanks.Comment #19
jjeff commentedI wonder if this is related to http://drupal.org/node/234581
The object output function in ConTemplate has been reworked to become devel_print_object() in the Devel module. It recurses through an object (the node object in the case of ConTemplate) and prints out all of its attributes.
There becomes a problem when any of the attributes are references to attributes higher up than themselves. The recursion gets caught in an endless loop, and PHP runs out of memory.
I tried to fix this in Devel by coming up with a maximum recursion depth, but it looks like this might not have fixed things over there. It might be worth looking at how Krumo handles these loops because it sounds like they've solved this problem.
Comment #20
jrglasgow commentedjjeff,
great idea, I don't know why I hadn't thought of it. I just committed a patch that will add a variable 'contemplate_max_recursion_depth' and setting this to 10. After hitting the recursion limit contemplate will display an error stating that it hit the recursion limit. This limit is set in 'admin/settings/contemplate'. These changes will be in release 6.x-0.12 and will soon be in dev.
Comment #21
Anonymous (not verified) commentedJust an FYI - I realize this is a bug being worked on but wanted to give feedback on 6.x-0.12. I went with the default 10 max recursion setting and got the PHP out of memory error. Same with setting it to 5 and then down to 2 for max recursion depth. The only way I could get around the PHP out of memory error was to check the "Remove $node->content from variable list".
Comment #22
jrglasgow commentedI fixed my code for tracking the recursion depth: the problem was I accidentally not passing the $depth variable into the contemplate_array_variables function when the item is an array. If you could all test out 6.x-0.13 and report back I would greatly apreciate it.
Thanks
Comment #23
jrglasgow commentedWhen we have successfully solved this problem I think we will be ready to release 6.x-1.0
Comment #24
Anonymous (not verified) commentedHappy to report that 6.x-0.13 worked. I went back to your default settings and can now create the template for my content type. Did get warnings but I'm sure you're not surprised about that.
Worked through setting up a template and it's usable. Thanks.
Comment #25
jrglasgow commentedI'm glad to hear it.
Comment #26
jrglasgow commentedsince there have been no other postings here i will assume that the problem has been satisfactorily fixed
Comment #27
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #28
Blueeeeie commentedHi,
I'm facing the same problem for my CCK but for 5.x version. The solutions and stuff here all seem to be for the 6.x version which I can't seem to apply to my version.
Is there a workaround for the 5.x version?
Any help is greatly appreciated.
regards,
Jamie
Comment #29
jrglasgow commentedHave you tried the latest version 5.x-2.02? Try that, and then let me know if you are still having problems.
Comment #30
Blueeeeie commentedHi,
Just to check, is it possible to install the new version without having to uninstall the old one? Because I'm worried that it will delete off some of my existing templates.
Thanks.
regards,
Jamie
Comment #31
jrglasgow commentedjust install the new version on top of the previous version, the new files will over write the old files. Then run update.php to make any database changes(I don't think there are any).
Comment #32
Blueeeeie commentedHi Hi,
The new version works. But when I click on the "edit template" link for 1 of my content types.. it displays an error message saying:
"While traversing node variables your recursion limit of 10 was hit 34 times"
What does that error message mean and should I be troubled by it?
regards,
Jamie
Comment #33
Phillip Mc commented#32 by Jamie, just to confirm I have the same problem with 5.x-2.0.
Comment #34
spade commentedSwitching from php4 to php5 helped me recover from this error. According to my ISP php5 has lesser memory needs ...
Comment #35
sunilkumar commentedEven the latest CCK with Drupal 6.4 I go the following message:
"While traversing node variables your recursion limit of 10 was hit 37 times. For more information about this error goto http://drupal.org/node/230885. This error will not effect the operation of Content Template, but it may not show you all available variables on this page. This error will only appear on this page."
What to do?
Regards,
-S-
Comment #36
wundo commentedHi Folks,
I'm having the same error here, and I'm seen the help message, could someone explain me more about it?
I would love to help...
Fabiano
Comment #37
greenskunkSubscribe
Comment #38
hewhocutsdown commentedI get it as well. I can enable Content and add a couple pieces (such as FiveStar or Email) and enable them without problems, but as soon as I add a few more (Content Copy, Content Permissions, etc) it breaks down.
I've been going into the database using the techniques here (http://drupal.org/node/157632) to get back to a working configuration but it's definitely a hindrance. Looking forward to a fix. :)
Comment #39
yched commentedI'm sorry but I'm not sure I get why this is an issue for CCK ?
Comment #40
femrich commentedI'm running Drupal 6.4; CCK 6.x-2.0-rc7; Content Templates 6.x-0.14; and latest recommended versions of Calendar, Date, email field, filefield, imagefield, and link. (There are also some other, non-CCK related modules.)
I have a content type using (in addition to default fields) five text fields and one image field.
I have created one node with this content type and filled in all fields (including the image) and have imagecache installed and applied to the image.
When I visit admin/content/templates/content_type_name, I still see the following:
While traversing node variables your recursion limit of 10 was hit 80 times. For more information about this error goto <a href="http://drupal.org/node/230885">http://drupal.org/node/230885</a>. This error will not effect the operation of Content Template, but it may not show you all available variables on this page. This error will only appear on this page.If I understand correctly, this means I can still create templates, but I won't get all the (much needed) helper text for the template?
Have now selected the "remove node content" option and the error seems to disappear. I will experiment with CT from here, but would be nice to find some way not to be faced with the error. Otherwise, things should work fine, eh?
Comment #41
Phillip Mc commentedchanging bug report to be for content templates.
Comment #42
jrglasgow commentedContent Template has been having issues with hitting PHP memory limits when loading some CCK nodes to display all variables. I put the recursion limit in the prevent this fatal error. You should still be able t create templates and have them function as expected.
Comment #43
inforeto commentedsubscribing.
pls, don't forget to backport to 5.x
Comment #44
steinmb commentedHi
Also get this. Clean installed D6.4. Get it on all content types with CCK based fields.
"While traversing node variables your recursion limit of 10 was hit 47 times. For more information about this error goto http://drupal.org/node/230885. This error will not effect the operation of Content Template, but it may not show you all available variables on this page. This error will only appear on this page."
PHP 5.2.5
PHP memory limit 96M
Drupal 6.4
Content Construction Kit (CCK) 6.x-2.0-rc8
Content Templates (Contemplate) 6.x-0.14
--
Steinmb
Comment #45
dermotholmes commentedAlso have it, subscribing
Latest MAMP
Drupal 6.5
cck-6.x-2.0-rc10
contemplate-6.x-0.14
Comment #46
jrglasgow commentedTry out the new release (6.x-0.16) and let me know if you are still having problems.
Comment #47
dermotholmes commentedThanks so much for the speedy reply, loaded up the new contemplate (6.x-0.16) and its all working a treat! Thanks sooo much!
-Dez
Comment #48
jrglasgow commentedI would hardly call it a speedy reply, I hve been trying to figure this out for a couple on months, It has just been a month since my last try and I got lucky.
Comment #49
steinmb commentedTested ver. 6.x-0.16 and it fixed the problem! Great work! :)
--
Steinmb
Comment #50
dreftymac commentedDrupal 6.5
Content Templates 6.x-0.16
Content 6.x-2.0-rc10
Comment #51
jgoldfeder commentedI'm getting the same error on:
Drupal 6.6
Content Templates 6.x-0.16
Content 6.x-2.0-rc10
Comment #52
rcharles commentedAny luck on the CCK/Contemplate recursion limit (message) issue? Recursion message shows with/after CCK fields deleted for content type.
Issue page lists version 6.x-v0.4-2? (March, 2008)
Project page lists version 6.x-v0.16 (Oct14th,2008)
Has 0.4-2 been rolled into 6.x-v1.0-dev?
Can 0.4-2 be used?
Comment #53
LynnS commentedGetting this error on the current 5, 10/14/08
Comment #54
venusrising commentedGetting this error after installing the update and the CCK Security Update I do not see any fixes for 5.12 anywhere. Please let us know.
While traversing node variables your recursion limit of 10 was hit 63 times. For more information about this error goto http://drupal.org/node/230885. This issue will not effect the operation of Content Template, but it may not show you all available variables on this page. This message will only appear on this page.
Comment #55
bizarrogir commentedI am also getting this problem, Drupal 6.4 , CCK 6.x-2.0-rc8.
Comment #56
venusrising commentedIs someone going to address this issue? I do not see any posted fixes for 5.
Comment #57
venusrising commentedError in the update
Comment #58
venusrising commentedThis is now affecting dependent content types. Going to try to rollback version, will post results.
Comment #59
bizarrogir commentedContemplate still works on custom CCK types as long as there are less than 10 fields in the type.
Comment #60
venusrising commentedWell with something like Advanced Profile Kit this does work as there are more than 10 fields and disabling them defeats the purpose of using the module for a more robust site. Thanks for the reply. I hope that some one looks at this at some point.
Comment #61
denislabonkink commentedI'm just letting you know that I get this error with version 6.x-1.0.
Comment #62
davoaxiom commentedI'm getting the following error only when I choose to the "add a Child Page" option in 6.8. The cause seems to be a combination between the CCK + Bookmadesimple + Book.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10462274 bytes) in /home/iowaunde/public_html/includes/database.mysql.inc on line 301
I do not get this error if I add a book page by going to node/add. It seems that the auto book outline seems to be causing the problem. Any ideas or sollutions?
Comment #63
cincy_kid commentedsame error:
While traversing node variables your recursion limit of 10 was hit 16 times. For more information about this error goto http://drupal.org/node/230885. This situation will not effect the operation of Content Template, but it may not show you all available variables on this page. This message will only appear on this page.
Drupal 6.9
PHP 5.2.6
CCK 6.X-2.1
Contemplate 6.X-0.16
Comment #64
quagmire commentedSame error message. I uploaded the latest security fixes today. Was working in flexifilter.
Comment #65
Holoduke commentedWhile traversing node variables your recursion limit of 10 was hit 3 times. For more information about this error goto http://drupal.org/node/230885. This situation will not effect the operation of Content Template, but it may not show you all available variables on this page. This message will only appear on this page.
I have changed memory limit to 80M.
drupal 6.12
CCK 6.x-2.4
6.x-1.1
Any ideas?
Comment #66
kasha_x commentedWorking off Drupal 6 with Contemplate 6.x-1.1 and getting this error. The custom content type has about 35 fields, but we've already inputted several hundred records (inventory for an audio store) and cannot go back after so many weeks of work. Does anyone have a solution?
Comment #67
kasha_x commentedChecked the the 'Remove $node->content from variable list.' option in Content Template settings and its working now. And quite relieved to be honest!
Comment #68
NickWebman commentedSame problem here.
Back to manual styling in CSS.
Comment #69
chipotle commentedSame problem for me as well.
It works on one of my new content types but not on the second. I get "the recursion limit of 10 was hit 21 times" as soon as I activate the template for this content type. When I display the node I see the first two fields (1 image, 1 textfield) displayed correctly but the rest of the fields (5 more, including a multigroup from the latest CCK dev version) only show the descriptor without the values.
Any chance this issues will be fixed in a reasonably short time frame? I looked into theming the content types from scratch and it will take me ages...
Thanks
Lars
P.S.: The used versions are Drupal 6.14, CCK 6.x-3.x-dev, Contemplate 6.x-1.1
Comment #70
sderrick commentedFatal error: Allowed memory size of 134217728 bytes exhausted
I just got this, I had php at 16M, its now at 128M to fix the problem.
Funny thing is so far its only happend on my test site, the production site with identical everything doesn;t get it?
cck 6.x.2.6
drupal 6.14
I don't have Contemplate installed
Comment #71
thekevinday commentedI get this with multigroup+cck+contemplate:
Comment #72
superfedya commentedsame here. Drupal 6.17, cck, contemplate and same problem:
While traversing node variables your recursion limit of 10 was hit 60 times. For more information about this error goto http://drupal.org/node/230885. This situation will not effect the operation of Content Template, but it may not show you all available variables on this page. This message will only appear on this page.
Any fix?
Comment #73
shane birley commentedHave you attempted increasing the recursion limit in the contemplate.module's configuration page?
Comment #74
drupert55 commentedHello.
I just downloaded Content Template today (6.x-1.x-dev) and saw the same error as #54 et al.
Not knowing much about what the error actually does or means, I went to the configuration (settings) page and checked "Remove $node->content from variable list." I kept the value of 'Max recursion depth' at 10.
Is this okay?
Thanks.
Comment #75
armyofda12mnkeys commentedI tried the same as above, but still got the error. All I have is 1 cck field for File upload.
PS would be nice to have a link on the Templates page to the setting page, even though they are in different areas, i think it would be very useful. I didnt realize there was a setting page until i got here and looked under different area of admin home screen.
Comment #76
lucky_lowell commentedGot the same familiar error
Nothing worked except !!!!
I had made one node with the content type I wanted to make a template with.
I erased the node and then tried again.
worked!
So I guess the order for me is make your content type
Then make your template
then create a node
Comment #77
pizangdesain commentedi have some problem too..
while go to content template page, never complete n stop RSS, save configuration button never show up.
Comment #78
anne1960 commentedWith drupal 7 errors again...I have contemplate version 7x1
Allowed memory size of 33554432 bytes exhausted (tried to allocate 162022 bytes) in C:\xampp\htdocs\drupal\sites\default\modules\contemplate\contemplate.module...
Comment #79
inforeto commented@76: yes, if you don't make a node there won't be any in the example node.
@78: exhausted memory is likely in the template not on the module.
check if your template have some slow code or errors, module calls, etc.
differs from the problem in this thread so you can open a new issue.
Comment #80
shane birley commented