In the content.devel.inc file you can find the content_generate_fields function. There's a TODO in the description so somebody might already be working on this.
I'll explain the situation: I have two textfields and one filefield (which is an image). Everytime the function is called to generate content, three images are generated instead of one (on the server and in the files table in the database).
I tried to see if the content would be generated correctly if I got rid of the first loop and that seemed to work..

..
if (!empty($type['fields'])) {
    //foreach ($type['fields'] as $field) {
      $node_field = array();
      ..

This might probably only work in my specific situation. Maybe there's someone who has a better solution?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hefox’s picture

Status: Active » Needs review
FileSize
40.25 KB

Removed the foreach and seems to work fine so far

hefox’s picture

forgot I had updated cck to see if helped, new patch.

hefox’s picture

Title: content_generate_fields() generates to much files » content_generate_fields() calls hook_content_generate too many times (filefield creates many files)