### Eclipse Workspace Patch 1.0
#P drupal_test_7
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.324
diff -u -r1.324 form.inc
--- includes/form.inc	14 Mar 2009 20:13:26 -0000	1.324
+++ includes/form.inc	25 Mar 2009 00:00:20 -0000
@@ -1874,6 +1874,10 @@
  * a child element, but is otherwise unaltered, so that the format selector is
  * at the same level as the text field which it affects.
  *
+ * Additionally, the #text_format_key property can be used to specify the name
+ * of the key under which the selected format can be retrieved in
+ * $form_state['values'].
+ *
  * For example:
  * @code
  *   // A simple textarea, such as a node body.
@@ -1920,7 +1924,7 @@
     // parents that filter_form() expects.
     $element_parents = $element['#parents'];
     $element_name = array_pop($element_parents);
-    $element_parents[] = $element_name . '_format';
+    $element_parents[] = isset($element['#text_format_key']) ? $element['#text_format_key'] : $element_name . '_format';
 
     // We need to break references, otherwise form_builder recurses infinitely.
     $element['value'] = (array)$element;
