Index: devel_generate.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/devel/devel_generate.inc,v retrieving revision 1.14 diff -u -r1.14 devel_generate.inc --- devel_generate.inc 15 Dec 2007 01:56:31 -0000 1.14 +++ devel_generate.inc 13 May 2008 16:54:38 -0000 @@ -88,7 +88,7 @@ if (module_exists("content")) { devel_generate_fields($node); } - + // Save the node: node_save($node); @@ -252,9 +252,9 @@ return substr($word, 0, $length); } -function devel_create_content() { +function devel_create_content($type = NULL) { $nparas = rand(1,12); - $type = rand(0,3); + $type = empty($type) ? rand(0,3) : $type; $output = ""; switch($type % 3) { @@ -418,46 +418,6 @@ * @return void **/ function devel_generate_fields(&$node) { - $type_name = $node->type; - $type = content_types($type_name); - $field_types = _content_field_types(); - - $return = array(); - if (!empty($type['fields'])) { - foreach ($type['fields'] as $field) { - // If module handles own multiples, then only call its hook once. - if (content_callback('field', 'multiple values', $field) != CONTENT_CALLBACK_DEFAULT) { - $max = 1; - } - else { - switch ($field['multiple']) { - case 0: - $max = 0; - break; - case 1: - $max = 2; //just an arbitrary number for 'unlimited' - break; - default: - $max = $field['multiple']; - break; - } - } - - for ($i=0; $i <= $max; $i++) { - $module = $field_types[$field['type']]['module']; - $function = $module .'_content_generate'; - if (function_exists($function)) { - $result = $function($op, $node, $field); // $items, $teaser, $page - if (is_array($result)) { - $return = array_merge($return, $result); - } - else if (isset($result)) { - $return[] = $result; - } - } - } - - $node->$field['field_name'] = $return; - } - } + include_once('./'. drupal_get_path('module', 'content') .'/includes/content.devel.inc'); + return content_generate_fields($node); } \ No newline at end of file Index: devel_generate.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/devel/devel_generate.module,v retrieving revision 1.11 diff -u -r1.11 devel_generate.module --- devel_generate.module 14 Jan 2008 13:05:13 -0000 1.11 +++ devel_generate.module 13 May 2008 14:50:34 -0000 @@ -74,7 +74,7 @@ foreach ($types as $type) { $warn = ''; if (count($type['fields'])) { - $warn = t('. Warning. This type contains CCK fields which won\'t be populated. See !url', array('!url' => l(t('this CCK issue.'), 'http://drupal.org/node/187599'))); + $warn = t('. This type contains CCK fields which will only be populated by fields that implement the content_generate hook.'); } $options[$type['type']] = t($type['name']). $warn; }