Index: comment_cck.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/comment_cck/comment_cck.module,v retrieving revision 1.13.2.1 diff -u -p -r1.13.2.1 comment_cck.module --- comment_cck.module 8 May 2009 20:32:08 -0000 1.13.2.1 +++ comment_cck.module 24 May 2009 07:59:59 -0000 @@ -50,8 +50,6 @@ function comment_cck_form_alter(&$form, $form['comment_filter']['comment_cck'] = $final_form; // Set the position of the comment_cck fields within the comment form. $form['comment_filter']['comment_cck']['#weight'] = -50; - // Set the comment_cck fields to output in the correct format. - $form['comment_filter']['comment_cck']['#tree'] = TRUE; } return; } @@ -101,7 +99,7 @@ function comment_cck_comment(&$comment, $original_node = node_load($comment['nid']); if ($fields = variable_get('comment_cck_fields_'. $original_node->type, array())) { // Ungroup the fields in this comment, if necessary. - $comment_fields = _comment_cck_ungroup_fields($comment['comment_cck'], $fields, $original_node->type); + $comment_fields = _comment_cck_ungroup_fields($comment, $fields, $original_node->type); // Merge the updated fields in this comment with the original node. $node = (object) array_merge((array) $original_node, $comment_fields); // We don't want a node revision, since we're updating an old comment. @@ -117,7 +115,7 @@ function comment_cck_comment(&$comment, $original_node = node_load($comment['nid']); if ($fields = variable_get('comment_cck_fields_'. $original_node->type, array())) { // Ungroup the fields in this comment, if necessary. - $comment_fields = _comment_cck_ungroup_fields($comment['comment_cck'], $fields, $original_node->type); + $comment_fields = _comment_cck_ungroup_fields($comment, $fields, $original_node->type); // Merge the updated fields in this comment with the original node. $node = (object) array_merge((array) $original_node, $comment_fields); $previous_vid = $node->vid; @@ -234,8 +232,8 @@ function comment_cck_preprocess_content_ */ function _comment_cck_ungroup_fields($comment_fields, $fields, $node_type) { // @TODO: I'm sure this can be improved, but it works for now. + $comment_fields_flat = array(); if (module_exists('fieldgroup')) { - $comment_fields_flat = array(); foreach ($fields as $key => $field) { if ($group_name = fieldgroup_get_group($node_type, $field)) { if ($comment_fields[$group_name][$field]) { @@ -246,8 +244,13 @@ function _comment_cck_ungroup_fields($co $comment_fields_flat[$key] = $comment_fields[$field]; } } - return $comment_fields_flat; } + else { + foreach ($fields as $key => $field) { + $comment_fields_flat[$key] = $comment_fields[$field]; + } + } + return $comment_fields_flat; } /**