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

jrglasgow’s picture

Status: Active » Fixed

CCK 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 the node['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-2

lurkerfilms’s picture

Version: 6.x-0.4-1 » 6.x-0.4-2

This 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.

jrglasgow’s picture

Status: Fixed » Active
kreynen’s picture

I 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.

kreynen’s picture

Spoke 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.

youngbuddha’s picture

Priority: Normal » Critical

I 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.

Fayna’s picture

I 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.

jrglasgow’s picture

Version: 6.x-0.4-2 » 6.x-0.8

The 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.

teebo’s picture

Version: 6.x-0.8 » 6.x-1.x-dev

Hi,

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.

teebo’s picture

I'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.

jallenb’s picture

Thanks teebo for the workaround. Looking forward to the patch.

bbinkovitz’s picture

I'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.

bbinkovitz’s picture

That temporary fix worked for me too. Thanks!

jrglasgow’s picture

Assigned: Unassigned » jrglasgow

Can 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.

rru’s picture

I 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']);
}

jrglasgow’s picture

The 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.

Anonymous’s picture

Just 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.

jrglasgow’s picture

I have implemented a new option in the code, there is now an option to completely remove $node->content from the variables list. Since this seems to be a big problem the option is enabled by default. These variables in the $node->content array 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.

jjeff’s picture

I 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.

jrglasgow’s picture

jjeff,
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.

Anonymous’s picture

Just 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".

jrglasgow’s picture

I 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

jrglasgow’s picture

When we have successfully solved this problem I think we will be ready to release 6.x-1.0

Anonymous’s picture

Happy 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.

jrglasgow’s picture

I'm glad to hear it.

jrglasgow’s picture

Status: Active » Fixed

since there have been no other postings here i will assume that the problem has been satisfactorily fixed

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

Blueeeeie’s picture

Version: 6.x-1.x-dev » 5.x-2.0
Status: Closed (fixed) » Active

Hi,

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

jrglasgow’s picture

Have you tried the latest version 5.x-2.02? Try that, and then let me know if you are still having problems.

Blueeeeie’s picture

Hi,

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

jrglasgow’s picture

just 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).

Blueeeeie’s picture

Hi 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

Phillip Mc’s picture

#32 by Jamie, just to confirm I have the same problem with 5.x-2.0.

spade’s picture

Switching from php4 to php5 helped me recover from this error. According to my ISP php5 has lesser memory needs ...

sunilkumar’s picture

Even 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-

wundo’s picture

Hi 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

greenskunk’s picture

Subscribe

hewhocutsdown’s picture

Project: Content Templates (Contemplate) » Content Construction Kit (CCK)
Version: 5.x-2.0 » 6.x-2.0-rc6
Component: Code » content.module

I 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. :)

yched’s picture

I'm sorry but I'm not sure I get why this is an issue for CCK ?

femrich’s picture

I'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?

Phillip Mc’s picture

Project: Content Construction Kit (CCK) » Content Templates (Contemplate)
Version: 6.x-2.0-rc6 » 6.x-0.9
Component: content.module » Code

changing bug report to be for content templates.

jrglasgow’s picture

Content 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.

inforeto’s picture

subscribing.

pls, don't forget to backport to 5.x

steinmb’s picture

Hi
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

dermotholmes’s picture

Priority: Critical » Normal

Also have it, subscribing

Latest MAMP

Drupal 6.5
cck-6.x-2.0-rc10
contemplate-6.x-0.14

jrglasgow’s picture

Try out the new release (6.x-0.16) and let me know if you are still having problems.

dermotholmes’s picture

Status: Active » Fixed

Thanks 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

jrglasgow’s picture

I 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.

steinmb’s picture

Tested ver. 6.x-0.16 and it fixed the problem! Great work! :)

--
Steinmb

dreftymac’s picture

Version: 6.x-0.9 » 6.x-0.16
Status: Fixed » Active
While traversing node variables your recursion limit of 10 was hit 156 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.5
Content Templates 6.x-0.16
Content 6.x-2.0-rc10

jgoldfeder’s picture

I'm getting the same error on:

Drupal 6.6
Content Templates 6.x-0.16
Content 6.x-2.0-rc10

rcharles’s picture

Any 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?

LynnS’s picture

Getting this error on the current 5, 10/14/08

venusrising’s picture

Category: bug » support
Priority: Normal » Critical

Getting 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.

bizarrogir’s picture

I am also getting this problem, Drupal 6.4 , CCK 6.x-2.0-rc8.

venusrising’s picture

Is someone going to address this issue? I do not see any posted fixes for 5.

venusrising’s picture

Version: 6.x-0.16 » 5.x-2.03
Category: support » bug

Error in the update

venusrising’s picture

This is now affecting dependent content types. Going to try to rollback version, will post results.

bizarrogir’s picture

Version: 5.x-2.03 » 6.x-0.16

Contemplate still works on custom CCK types as long as there are less than 10 fields in the type.

venusrising’s picture

Well 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.

denislabonkink’s picture

Version: 6.x-0.16 » 6.x-1.0

I'm just letting you know that I get this error with version 6.x-1.0.

davoaxiom’s picture

I'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?

cincy_kid’s picture

same 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

quagmire’s picture

Version: 6.x-1.0 » 6.x-0.13

Same error message. I uploaded the latest security fixes today. Was working in flexifilter.

Holoduke’s picture

While 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?

kasha_x’s picture

Working 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?

kasha_x’s picture

Checked the the 'Remove $node->content from variable list.' option in Content Template settings and its working now. And quite relieved to be honest!

NickWebman’s picture

Same problem here.

Back to manual styling in CSS.

chipotle’s picture

Same 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

sderrick’s picture

Fatal 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

thekevinday’s picture

I get this with multigroup+cck+contemplate:

While traversing node variables your recursion limit of 10 was hit 567 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.

superfedya’s picture

same 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?

shane birley’s picture

Have you attempted increasing the recursion limit in the contemplate.module's configuration page?

drupert55’s picture

Hello.

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.

armyofda12mnkeys’s picture

I 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.

lucky_lowell’s picture

Got 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

pizangdesain’s picture

i have some problem too..
while go to content template page, never complete n stop RSS, save configuration button never show up.

anne1960’s picture

With 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...

inforeto’s picture

@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.

shane birley’s picture

Issue summary: View changes
Status: Active » Closed (outdated)