? logs
? sites/sites.php
? sites/all/README.txt
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1071
diff -u -p -r1.1071 common.inc
--- includes/common.inc 27 Dec 2009 15:23:49 -0000 1.1071
+++ includes/common.inc 30 Dec 2009 16:15:05 -0000
@@ -5600,9 +5600,6 @@ function drupal_common_theme() {
'form_element_label' => array(
'render element' => 'element',
),
- 'text_format_wrapper' => array(
- 'render element' => 'element',
- ),
'vertical_tabs' => array(
'render element' => 'element',
),
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.422
diff -u -p -r1.422 form.inc
--- includes/form.inc 29 Dec 2009 20:16:09 -0000 1.422
+++ includes/form.inc 30 Dec 2009 16:15:06 -0000
@@ -2090,110 +2090,6 @@ function form_process_radios($element) {
}
/**
- * Add text format selector to text elements with the #text_format property.
- *
- * The #text_format property should be the ID of an text format, found in
- * {filter_format}.format, which gets passed to filter_form().
- *
- * If the property #text_format is set, the form element will be expanded into
- * two separate form elements, one holding the content of the element, and the
- * other holding the text format selector. The original element is shifted into
- * a child element, but is otherwise unaltered, so that the format selector is
- * at the same level as the text field which it affects.
- *
- * For example:
- * @code
- * // A simple textarea, such as a node body.
- * $form['body'] = array(
- * '#type' => 'textarea',
- * '#title' => t('Body'),
- * '#text_format' => isset($node->format) ? $node->format : filter_default_format(),
- * );
- * @endcode
- *
- * Becomes:
- * @code
- * $form['body'] = array(
- * // Type switches to 'markup', as we're only interested in submitting the child elements.
- * '#type' => 'markup',
- * // 'value' holds the original element.
- * 'value' => array(
- * '#type' => 'textarea',
- * '#title' => t('Body'),
- * '#parents' => array('body'),
- * ),
- * // 'format' holds the text format selector.
- * 'format' => array(
- * '#parents' => array('body_format'),
- * ...
- * ),
- * );
- * @endcode
- *
- * And would result in:
- * @code
- * // Original, unaltered form element value.
- * $form_state['values']['body'] = 'Example content';
- * // Chosen text format.
- * $form_state['values']['body_format'] = 1;
- * @endcode
- *
- * @see system_element_info(), filter_form()
- */
-function form_process_text_format($element) {
- if (isset($element['#text_format'])) {
- // Determine the form element parents and element name to use for the input
- // format widget. This simulates the 'element' and 'element_format' pair of
- // parents that filter_form() expects.
- $element_parents = $element['#parents'];
- $element_name = array_pop($element_parents);
- $element_parents[] = $element_name . '_format';
-
- // We need to break references, otherwise form_builder recurses infinitely.
- $element['value'] = (array)$element;
- $element['value']['#weight'] = 0;
- unset($element['value']['#description']);
- $element['#type'] = 'markup';
- $element['#theme'] = NULL;
- $element['#theme_wrappers'] = array('text_format_wrapper');
- $element['format'] = filter_form($element['#text_format'], 1, $element_parents);
-
- // We need to clear the #text_format from the new child otherwise we
- // would get into an infinite loop.
- unset($element['value']['#text_format']);
- }
- return $element;
-}
-
-/**
- * Theme a text format form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #children, #description
- *
- * @return
- * A string representing the form element.
- *
- * @ingroup themeable
- */
-function theme_text_format_wrapper($variables) {
- $element = $variables['element'];
- $output = '
' . "\n";
-
- $output .= $element['#children'] . "\n";
-
- if (!empty($element['#description'])) {
- $output .= '
' . $element['#description'] . "
\n";
- }
-
- $output .= "
\n";
-
- return $output;
-}
-
-/**
* Theme a checkbox form element.
*
* @param $variables
Index: misc/form.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/form.js,v
retrieving revision 1.13
diff -u -p -r1.13 form.js
--- misc/form.js 5 Dec 2009 15:04:33 -0000 1.13
+++ misc/form.js 30 Dec 2009 16:15:06 -0000
@@ -59,23 +59,6 @@ Drupal.behaviors.formUpdated = {
};
/**
- * Automatically display the guidelines of the selected text format.
- */
-Drupal.behaviors.filterGuidelines = {
- attach: function (context) {
- $('.filter-guidelines', context).once('filter-guidelines')
- .find('label').hide()
- .parents('.filter-wrapper').find('select.filter-list')
- .bind('change', function () {
- $(this).parents('.filter-wrapper')
- .find('.filter-guidelines-item').hide()
- .siblings('#filter-guidelines-' + this.value).show();
- })
- .change();
- }
-};
-
-/**
* Prepopulate form fields with information from the visitor cookie.
*/
Drupal.behaviors.fillUserInfoFromCookie = {
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.67
diff -u -p -r1.67 block.admin.inc
--- modules/block/block.admin.inc 14 Dec 2009 13:32:53 -0000 1.67
+++ modules/block/block.admin.inc 30 Dec 2009 16:15:07 -0000
@@ -468,7 +468,7 @@ function block_add_block_form_submit($fo
->fields(array(
'body' => $form_state['values']['body'],
'info' => $form_state['values']['info'],
- 'format' => $form_state['values']['body_format'],
+ 'format' => $form_state['values']['format'],
))
->execute();
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.404
diff -u -p -r1.404 block.module
--- modules/block/block.module 18 Dec 2009 07:17:50 -0000 1.404
+++ modules/block/block.module 30 Dec 2009 16:15:07 -0000
@@ -421,10 +421,10 @@ function block_custom_block_form($edit =
);
$form['body_field']['#weight'] = -17;
$form['body_field']['body'] = array(
- '#type' => 'textarea',
+ '#type' => 'textarea_format',
'#title' => t('Block body'),
'#default_value' => $edit['body'],
- '#text_format' => isset($edit['format']) ? $edit['format'] : filter_default_format(),
+ '#format' => isset($edit['format']) ? $edit['format'] : NULL,
'#rows' => 15,
'#description' => t('The content of the block as shown to the user.'),
'#required' => TRUE,
@@ -453,7 +453,7 @@ function block_custom_block_save($edit,
->fields(array(
'body' => $edit['body'],
'info' => $edit['info'],
- 'format' => $edit['body_format'],
+ 'format' => $edit['format'],
))
->condition('bid', $delta)
->execute();
Index: modules/block/block.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.test,v
retrieving revision 1.33
diff -u -p -r1.33 block.test
--- modules/block/block.test 1 Dec 2009 22:30:30 -0000 1.33
+++ modules/block/block.test 30 Dec 2009 16:15:07 -0000
@@ -79,7 +79,7 @@ class BlockTestCase extends DrupalWebTes
$custom_block['info'] = $this->randomName(8);
$custom_block['title'] = $this->randomName(8);
$custom_block['body'] = 'Full HTML
';
- $custom_block['body_format'] = 2;
+ $custom_block['format'] = 2;
$this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
// Set the created custom block to a specific region.
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.822
diff -u -p -r1.822 comment.module
--- modules/comment/comment.module 26 Dec 2009 16:50:08 -0000 1.822
+++ modules/comment/comment.module 30 Dec 2009 16:15:08 -0000
@@ -1302,7 +1302,7 @@ function comment_save($comment) {
'changed' => $comment->changed,
'subject' => $comment->subject,
'comment' => $comment->comment,
- 'format' => $comment->comment_format,
+ 'format' => $comment->format,
'uid' => $comment->uid,
'name' => $comment->name,
'mail' => $comment->mail,
@@ -1378,7 +1378,7 @@ function comment_save($comment) {
'uid' => $comment->uid,
'subject' => $comment->subject,
'comment' => $comment->comment,
- 'format' => $comment->comment_format,
+ 'format' => $comment->format,
'hostname' => ip_address(),
'created' => $comment->created,
'changed' => $comment->changed,
@@ -1822,10 +1822,10 @@ function comment_form($form, &$form_stat
'#access' => variable_get('comment_subject_field_' . $node->type, 1) == 1,
);
$form['comment'] = array(
- '#type' => 'textarea',
+ '#type' => 'textarea_format',
'#title' => t('Comment'),
'#default_value' => $comment->comment,
- '#text_format' => isset($comment->format) ? $comment->format : filter_default_format(),
+ '#format' => isset($comment->format) ? $comment->format : NULL,
'#required' => TRUE,
'#rows' => 15,
);
@@ -1887,8 +1887,6 @@ function comment_preview($comment) {
$node = node_load($comment->nid);
if (!form_get_errors()) {
- $comment->format = $comment->comment_format;
-
// Attach the user and time information.
if (!empty($comment->name)) {
$account = user_load_by_name($comment->name);
@@ -2015,7 +2013,7 @@ function comment_submit($comment) {
// 1) Filter it into HTML
// 2) Strip out all HTML tags
// 3) Convert entities back to plain-text.
- $comment['subject'] = truncate_utf8(trim(decode_entities(strip_tags(check_markup($comment['comment'], $comment['comment_format'])))), 29, TRUE);
+ $comment['subject'] = truncate_utf8(trim(decode_entities(strip_tags(check_markup($comment['comment'], $comment['format'])))), 29, TRUE);
// Edge cases where the comment body is populated only by HTML tags will
// require a default subject.
if ($comment['subject'] == '') {
Index: modules/comment/comment.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.pages.inc,v
retrieving revision 1.33
diff -u -p -r1.33 comment.pages.inc
--- modules/comment/comment.pages.inc 27 Dec 2009 03:43:45 -0000 1.33
+++ modules/comment/comment.pages.inc 30 Dec 2009 16:15:08 -0000
@@ -108,7 +108,6 @@ function comment_reply($node, $pid = NUL
*/
function comment_approve($comment) {
$comment->status = COMMENT_PUBLISHED;
- $comment->comment_format = $comment->format;
comment_save($comment);
drupal_set_message(t('Comment approved.'));
Index: modules/field/modules/text/text.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v
retrieving revision 1.45
diff -u -p -r1.45 text.module
--- modules/field/modules/text/text.module 21 Dec 2009 13:47:32 -0000 1.45
+++ modules/field/modules/text/text.module 30 Dec 2009 16:15:08 -0000
@@ -553,11 +553,10 @@ function text_field_widget_form(&$form,
break;
}
+ // Conditionally alter the form element's type if text processing is enabled.
if ($instance['settings']['text_processing']) {
- $element['value']['#text_format'] = isset($items[$delta]['format']) ? $items[$delta]['format'] : filter_default_format();
- $element['#type'] = 'markup';
- $element['#input'] = TRUE;
- $element['#value_callback'] = 'text_field_widget_formatted_text_value';
+ $element['value']['#type'] .= '_format';
+ $element['value']['#format'] = isset($items[$delta]['format']) ? $items[$delta]['format'] : NULL;
}
return $element;
@@ -580,19 +579,3 @@ function text_field_widget_error($elemen
form_error($error_element, $error['message']);
}
-/**
- * Form element #value_callback to re-assign text format value for a formatted text widget.
- *
- * #text_format puts the format into 'value_format', while we need it in
- * 'format'.
- */
-function text_field_widget_formatted_text_value($element, $edit = FALSE, &$form_state) {
- if ($edit !== FALSE) {
- // The format selector uses #access = FALSE if only one format is
- // available. In this case, we don't receive its value, and need to
- // manually set it.
- $edit['format'] = !empty($edit['value_format']) ? $edit['value_format'] : filter_default_format();
- unset($edit['value_format']);
- return $edit;
- }
-}
Index: modules/field/modules/text/text.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.test,v
retrieving revision 1.17
diff -u -p -r1.17 text.test
--- modules/field/modules/text/text.test 13 Dec 2009 09:04:55 -0000 1.17
+++ modules/field/modules/text/text.test 30 Dec 2009 16:15:08 -0000
@@ -166,7 +166,7 @@ class TextFieldTestCase extends DrupalWe
// no format selector will be displayed.
$this->drupalGet('test-entity/add/test-bundle');
$this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', t('Widget is displayed'));
- $this->assertNoFieldByName("{$this->field_name}[$langcode][0][value_format]", '', t('Format selector is not displayed'));
+ $this->assertNoFieldByName("{$this->field_name}[$langcode][0][format]", '', t('Format selector is not displayed'));
// Submit with data that should be filtered.
$value = '' . $this->randomName() . '';
@@ -202,11 +202,11 @@ class TextFieldTestCase extends DrupalWe
// We should now have a 'text format' selector.
$this->drupalGet('test-entity/' . $id . '/edit');
$this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', t('Widget is displayed'));
- $this->assertFieldByName("{$this->field_name}[$langcode][0][value_format]", '', t('Format selector is displayed'));
+ $this->assertFieldByName("{$this->field_name}[$langcode][0][format]", '', t('Format selector is displayed'));
// Edit and change the text format to the new one that was created.
$edit = array(
- "{$this->field_name}[$langcode][0][value_format]" => $format_id,
+ "{$this->field_name}[$langcode][0][format]" => $format_id,
);
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertRaw(t('test_entity @id has been updated.', array('@id' => $id)), t('Entity was updated'));
Index: modules/filter/filter.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.css,v
retrieving revision 1.2
diff -u -p -r1.2 filter.css
--- modules/filter/filter.css 14 Dec 2009 13:32:53 -0000 1.2
+++ modules/filter/filter.css 30 Dec 2009 16:15:08 -0000
@@ -11,7 +11,6 @@
}
.filter-wrapper .form-item {
float: left;
- margin: 0;
padding: 0 0 0.5em 1.5em;
}
.filter-wrapper .form-item label {
Index: modules/filter/filter.js
===================================================================
RCS file: modules/filter/filter.js
diff -N modules/filter/filter.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/filter/filter.js 30 Dec 2009 16:15:08 -0000
@@ -0,0 +1,21 @@
+// $Id: form.js,v 1.12 2009/10/16 16:37:00 dries Exp $
+(function ($) {
+
+/**
+ * Automatically display the guidelines of the selected text format.
+ */
+Drupal.behaviors.filterGuidelines = {
+ attach: function (context) {
+ $('.filter-guidelines', context).once('filter-guidelines')
+ .find('label').hide()
+ .parents('.filter-wrapper').find('select.filter-list')
+ .bind('change', function () {
+ $(this).parents('.filter-wrapper')
+ .find('.filter-guidelines-item').hide()
+ .siblings('#filter-guidelines-' + this.value).show();
+ })
+ .change();
+ }
+};
+
+})(jQuery);
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.314
diff -u -p -r1.314 filter.module
--- modules/filter/filter.module 28 Dec 2009 21:52:13 -0000 1.314
+++ modules/filter/filter.module 30 Dec 2009 16:15:09 -0000
@@ -54,6 +54,9 @@ function filter_theme() {
'variables' => array('tips' => NULL, 'long' => FALSE),
'file' => 'filter.pages.inc',
),
+ 'filter_format_wrapper' => array(
+ 'render element' => 'element',
+ ),
'filter_tips_more_info' => array(
'variables' => array(),
),
@@ -64,6 +67,24 @@ function filter_theme() {
}
/**
+ * Implement of hook_elements().
+ *
+ * Elements defined by Filter module are wrappers around the respective,
+ * non-prefixed elements and are expanded by filter_process_format().
+ *
+ * @see filter_process_format()
+ */
+function filter_element_info() {
+ $type['textfield_format'] = array(
+ '#process' => array('filter_process_format'),
+ );
+ $type['textarea_format'] = array(
+ '#process' => array('filter_process_format'),
+ );
+ return $type;
+}
+
+/**
* Implements hook_menu().
*/
function filter_menu() {
@@ -655,69 +676,175 @@ function check_markup($text, $format_id
/**
* Generates a selector for choosing a format in a form.
*
- * @param $selected_format
- * The ID of the format that is currently selected; uses the default format
- * for the current user if not provided.
- * @param $weight
- * The weight of the form element within the form.
- * @param $parents
- * The parents array of the element. Required when defining multiple text
- * formats on a single form or having a different parent than 'format'.
+ * The form element will be expanded into two separate form elements, one
+ * holding the original element, and the other holding the text format selector.
+ * The original element is shifted into a child element, but is otherwise
+ * unaltered, so that the format selector is at the same level as the element
+ * which it affects.
+ *
+ * The optional #format property should be the ID of an text format, found in
+ * {filter_format}.format, or NULL to use the default format for the current
+ * user. For example:
+ * @code
+ * $form['some']['field'] = array(
+ * '#type' => 'textarea_format',
+ * '#title' => t('My field'),
+ * '#format' => isset($node->format) ? $node->format : NULL,
+ * '#default_value' => 'Some to be filtered text.',
+ * );
+ * @endcode
+ *
+ * Becomes:
+ * @code
+ * $form['some']['field'] = array(
+ * '#type' => 'markup',
+ * // 'value' holds the original element.
+ * 'value' => array(
+ * '#type' => 'textarea',
+ * '#title' => t('My field'),
+ * '#default_value' => 'Some to be filtered text.',
+ * // Albeit the form structure is changed, the submitted value will still
+ * // appear where the original element was located:
+ * '#parents' => array('some', 'field'),
+ * ),
+ * // 'format' holds the text format widget.
+ * 'format' => array(
+ * // The 'format' value will appear next to the original element.
+ * '#parents' => array('some', 'format'),
+ * ),
+ * );
+ * @endcode
+ *
+ * Which results in the submitted form values:
+ * @code
+ * // Original form element value.
+ * $form_state['values']['some']['field'] = 'Some to be filtered text.';
+ * // Chosen text format.
+ * $form_state['values']['some']['format'] = 1;
+ * @endcode
+ *
+ * @param $element
+ * The form element to process. Properties used:
+ * - #type: A form element #type suffixed with '_format'. The form element for
+ * 'value' will use this #type without the '_format' suffix. For example,
+ * if the to be processed form element specifies 'textarea_format', then the
+ * new child element in 'value' will use the #type 'textarea'. By default,
+ * Filter module registers 'textarea_format' and 'textfield_format' in
+ * filter_element_info(). Custom implementations needs to register the
+ * suffixed '_format' types in hook_element_info().
+ * - #format: (optional) The text format id to preselect. If 0, NULL, or not
+ * defined, the default format for the current user will be used.
*
* @return
- * Form API array for the form element.
- *
- * @ingroup forms
+ * The expanded element.
*/
-function filter_form($selected_format = NULL, $weight = NULL, $parents = array('format')) {
+function filter_process_format($element) {
global $user;
- // Use the default format for this user if none was selected.
- if (empty($selected_format)) {
- $selected_format = filter_default_format($user);
- }
-
+ // The element will be expanded into two new child elements 'value' and
+ // 'format', but only in the form structure. The original element's value is
+ // expected at its original location of the form structure and the new born
+ // 'format' element's value is expected next to it on the same level. To do
+ // this, we take the original element's #parents property, apply it to the new
+ // 'value' element, and make the new 'format' element use the same parents.
+ $format_parents = $element['#parents'];
+ // Make 'format' appear on the same level as the passed in element.
+ array_pop($format_parents);
+ $format_parents[] = 'format';
+
+ // Move this element into sub-element 'value'. Break references and remove
+ // this #process function to prevent form_builder() to recurse infinitely.
+ $element['value'] = (array) $element;
+ $element['value']['#process'] = array_diff($element['value']['#process'], array('filter_process_format'));
+
+ // Turn this element into a text format wrapper.
+ $element['#type'] = 'markup';
+ unset($element['#theme']);
+ $element['#theme_wrappers'] = array('filter_format_wrapper');
+ $path = drupal_get_path('module', 'filter');
+ $element['#attached']['js'][] = $path . '/filter.js';
+ $element['#attached']['css'][] = $path . '/filter.css';
+
+ // Setup child element for the value.
+ // The #type without '_format' suffix is expected to be a valid #type. This
+ // allows to enhance further (and custom) form elements with text formats.
+ $element['value']['#type'] = strtr($element['value']['#type'], array('_format' => ''));
+ $element['value'] += element_info($element['value']['#type']);
+ // Description is handled by theme_filter_format_wrapper() and weight needs
+ // to be reset to ensure proper ordering.
+ unset($element['value']['#description'], $element['value']['#weight']);
+ // Unset properties that will be processed for the original element already.
+ unset($element['value']['#prefix'], $element['value']['#suffix'], $element['value']['#attached']);
+
+ // Setup child element for the text format widget.
+ $element['format'] = element_info('fieldset');
+ $element['format']['#defaults_loaded'] = TRUE;
+ $element['format']['#attributes']['class'][] = 'filter-wrapper';
+
+ // Prepare text format guidelines.
+ $element['format']['guidelines'] = array(
+ '#type' => 'container',
+ '#attributes' => array('class' => array('filter-guidelines')),
+ '#weight' => 20,
+ );
// Get a list of formats that the current user has access to.
$formats = filter_formats($user);
-
- drupal_add_js('misc/form.js');
- drupal_add_css(drupal_get_path('module', 'filter') . '/filter.css');
- $element_id = drupal_html_id('edit-' . implode('-', $parents));
-
- $form = array(
- '#type' => 'fieldset',
- '#weight' => $weight,
- '#attributes' => array('class' => array('filter-wrapper')),
- );
- $form['format_guidelines'] = array(
- '#prefix' => '',
- '#suffix' => '
',
- '#weight' => 2,
- );
foreach ($formats as $format) {
$options[$format->format] = $format->name;
- $form['format_guidelines'][$format->format] = array(
- '#markup' => theme('filter_guidelines', array('format' => $format)),
+ $element['format']['guidelines'][$format->format] = array(
+ '#theme' => 'filter_guidelines',
+ '#format' => $format,
);
}
- $form['format'] = array(
+
+ // Use the default format for this user if none was selected.
+ if (empty($element['#format'])) {
+ $element['#format'] = filter_default_format($user);
+ }
+ $element['format']['format'] = array(
'#type' => 'select',
'#title' => t('Text format'),
'#options' => $options,
- '#default_value' => $selected_format,
- '#parents' => $parents,
+ '#default_value' => $element['#format'],
'#access' => count($formats) > 1,
- '#id' => $element_id,
+ '#weight' => 10,
'#attributes' => array('class' => array('filter-list')),
+ '#parents' => $format_parents,
);
- $form['format_help'] = array(
- '#prefix' => '',
- '#markup' => theme('filter_tips_more_info'),
- '#suffix' => '
',
- '#weight' => 1,
+
+ $element['format']['help'] = array(
+ '#type' => 'container',
+ '#theme' => 'filter_tips_more_info',
+ '#attributes' => array('class' => array('filter-help')),
+ '#weight' => 0,
);
- return $form;
+ return $element;
+}
+
+/**
+ * Theme a text format form element.
+ *
+ * @param $variables
+ * An associative array containing:
+ * - element: An associative array containing the properties of the element.
+ * Properties used: #children, #description
+ *
+ * @return
+ * A string representing the form element.
+ *
+ * @ingroup themeable
+ */
+function theme_filter_format_wrapper($variables) {
+ $element = $variables['element'];
+ $output = '';
+ $output .= $element['#children'];
+ if (!empty($element['#description'])) {
+ $output .= '
' . $element['#description'] . '
';
+ }
+ $output .= "
\n";
+
+ return $output;
}
/**
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.53
diff -u -p -r1.53 filter.test
--- modules/filter/filter.test 14 Dec 2009 13:32:53 -0000 1.53
+++ modules/filter/filter.test 30 Dec 2009 16:15:09 -0000
@@ -292,7 +292,7 @@ class FilterAdminTestCase extends Drupal
$langcode = LANGUAGE_NONE;
$edit["title[$langcode][0][value]"] = $this->randomName();
$edit["body[$langcode][0][value]"] = $text;
- $edit["body[$langcode][0][value_format]"] = $filtered;
+ $edit["body[$langcode][0][format]"] = $filtered;
$this->drupalPost('node/add/page', $edit, t('Save'));
$this->assertRaw(t('Page %title has been created.', array('%title' => $edit["title[$langcode][0][value]"])), t('Filtered node created.'));
@@ -304,7 +304,7 @@ class FilterAdminTestCase extends Drupal
// Use plain text and see if it escapes all tags, whether allowed or not.
$edit = array();
- $edit["body[$langcode][0][value_format]"] = $plain;
+ $edit["body[$langcode][0][format]"] = $plain;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
$this->drupalGet('node/' . $node->nid);
$this->assertText(check_plain($text), t('The "Plain text" text format escapes all HTML tags.'));
@@ -1180,7 +1180,7 @@ class FilterHooksTestCase extends Drupal
$custom_block['title'] = $this->randomName(8);
$custom_block['body'] = $this->randomName(32);
// Use the format created.
- $custom_block['body_format'] = $format_id;
+ $custom_block['format'] = $format_id;
$this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
$this->assertText(t('The block has been created.'), t('New block successfully created.'));
Index: modules/php/php.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/php/php.test,v
retrieving revision 1.20
diff -u -p -r1.20 php.test
--- modules/php/php.test 3 Dec 2009 15:33:42 -0000 1.20
+++ modules/php/php.test 30 Dec 2009 16:15:10 -0000
@@ -77,7 +77,7 @@ class PHPFilterTestCase extends PHPTestC
// Change filter to PHP filter and see that PHP code is evaluated.
$edit = array();
$langcode = LANGUAGE_NONE;
- $edit["body[$langcode][0][value_format]"] = $this->php_code_format;
+ $edit["body[$langcode][0][format]"] = $this->php_code_format;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
$this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), t('PHP code filter turned on.'));
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.45
diff -u -p -r1.45 search.test
--- modules/search/search.test 9 Dec 2009 19:22:04 -0000 1.45
+++ modules/search/search.test 30 Dec 2009 16:15:10 -0000
@@ -491,7 +491,7 @@ class SearchCommentTestCase extends Drup
$edit_comment = array(
'subject' => $this->randomName(2),
'comment' => '' . $comment_body . '
',
- 'comment_format' => 2,
+ 'format' => 2,
);
$this->drupalPost('comment/reply/' . $node->nid, $edit_comment, t('Save'));
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.862
diff -u -p -r1.862 system.module
--- modules/system/system.module 15 Dec 2009 08:45:32 -0000 1.862
+++ modules/system/system.module 30 Dec 2009 16:15:12 -0000
@@ -353,7 +353,7 @@ function system_element_info() {
'#size' => 60,
'#maxlength' => 128,
'#autocomplete_path' => FALSE,
- '#process' => array('form_process_text_format', 'ajax_process_form'),
+ '#process' => array('ajax_process_form'),
'#theme' => 'textfield',
'#theme_wrappers' => array('form_element'),
);
@@ -375,7 +375,7 @@ function system_element_info() {
'#cols' => 60,
'#rows' => 5,
'#resizable' => TRUE,
- '#process' => array('form_process_text_format', 'ajax_process_form'),
+ '#process' => array('ajax_process_form'),
'#theme' => 'textarea',
'#theme_wrappers' => array('form_element'),
);
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.86
diff -u -p -r1.86 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc 2 Dec 2009 14:56:32 -0000 1.86
+++ modules/taxonomy/taxonomy.admin.inc 30 Dec 2009 16:15:12 -0000
@@ -648,13 +648,14 @@ function taxonomy_form_term($form, &$for
'#title' => t('Term name'),
'#default_value' => $edit['name'],
'#maxlength' => 255,
- '#required' => TRUE);
+ '#required' => TRUE,
+ );
$form['identification']['description'] = array(
- '#type' => 'textarea',
+ '#type' => 'textarea_format',
'#title' => t('Description'),
'#default_value' => $edit['description'],
'#description' => t('A description of the term. To be displayed on taxonomy/term pages and RSS feeds.'),
- '#text_format' => $edit['format'],
+ '#format' => $edit['format'],
);
$form['vocabulary_machine_name'] = array(
@@ -770,10 +771,6 @@ function taxonomy_form_term_submit($form
return;
}
- // Massage #text_format.
- $form_state['values']['format'] = $form_state['values']['description_format'];
- unset($form_state['values']['description_format']);
-
$term = taxonomy_form_term_submit_builder($form, $form_state);
$status = taxonomy_term_save($term);