? maxlength-466396.patch Index: maxlength.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/maxlength/maxlength.module,v retrieving revision 1.11.4.11.2.2 diff -u -p -r1.11.4.11.2.2 maxlength.module --- maxlength.module 1 Apr 2009 23:59:29 -0000 1.11.4.11.2.2 +++ maxlength.module 6 Jun 2009 16:03:57 -0000 @@ -61,14 +61,17 @@ function _maxlength_content_form_alter(& // Update the body as needed _maxlength_format_element($form['body_field']['body'], $form['body_field']['body']['#default_value'],'body', 'body', $type); - // Get a list of all the CCK fields for this content type - $list = array_keys(content_fields(NULL, $type)); - // Update CCK fields as needed - foreach ($list as $field) { - if (is_array($form[$field])) { - foreach (element_children($form[$field]) as $key) { - _maxlength_format_element($form[$field][$key], $form[$field][$key]['value'], $field, str_replace('_', '-', $field) .'-'. $key .'-value', $type); + if (module_exists('content') { + // Get a list of all the CCK fields for this content type + $list = array_keys(content_fields(NULL, $type)); + + // Update CCK fields as needed + foreach ($list as $field) { + if (is_array($form[$field])) { + foreach (element_children($form[$field]) as $key) { + _maxlength_format_element($form[$field][$key], $form[$field][$key]['value'], $field, str_replace('_', '-', $field) .'-'. $key .'-value', $type); + } } } }