diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index 88bda07541bf796c2bf3f603c1b020389b7f1acb..d869153de709ba8c73afc3068eba9c368e0275cd 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -129,13 +129,6 @@ function node_type_form(&$form_state, $type = NULL) { '#default_value' => isset($type->body_label) ? $type->body_label : '', '#description' => t('To omit the body field for this content type, remove any text and leave this field blank.'), ); - $form['submission']['min_word_count'] = array( - '#type' => 'select', - '#title' => t('Minimum number of words'), - '#default_value' => $type->min_word_count, - '#options' => drupal_map_assoc(array(0, 1, 10, 25, 50, 75, 100, 125, 150, 175, 200)), - '#description' => t('The minimum number of words for the body field to be considered valid for this content type. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.') - ); $form['submission']['node_preview'] = array( '#type' => 'radios', '#title' => t('Preview post'), @@ -289,7 +282,6 @@ function node_type_form_submit($form, &$form_state) { $type->description = $form_state['values']['description']; $type->help = $form_state['values']['help']; - $type->min_word_count = $form_state['values']['min_word_count']; $type->title_label = $form_state['values']['title_label']; $type->body_label = $form_state['values']['body_label']; diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 9938a6f9f58f346a7c4d812d886f0ba137c45e0d..42ba87971a52d324c0c9e8677f8ea487405f682f 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -540,8 +540,6 @@ function hook_node_build_alter($node, $build_mode) { * field. Optional (defaults to TRUE). * - "body_label": the label for the body field of this content type. Optional * (defaults to 'Body'). - * - "min_word_count": the minimum number of words for the body field to be - * considered valid for this content type. Optional (defaults to 0). * - "locked": boolean indicating whether the machine-readable name of this * content type can (FALSE) or cannot (TRUE) be edited by a site * administrator. Optional (defaults to TRUE). diff --git a/modules/node/node.install b/modules/node/node.install index d81626f52bd11deae1796fa2ecf2184446a3ae3a..26f4f81a36d9261aab35e77ebd4dc9c0263888bc 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -299,13 +299,6 @@ function node_schema() { 'not null' => TRUE, 'default' => '', ), - 'min_word_count' => array( - 'description' => 'The minimum number of words the body must contain.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'size' => 'small', - ), 'custom' => array( 'description' => 'A boolean indicating whether this type is defined by a module (FALSE) or by a user via a module like the Content Construction Kit (TRUE).', 'type' => 'int', @@ -523,6 +516,15 @@ function node_update_7005(&$context) { return $ret; } +/** + * Remove column min_word_count. + */ +function node_update_7006() { + $ret = array(); + db_drop_field($ret, 'node_type', 'min_word_count'); + return $ret; +} + /** diff --git a/modules/node/node.module b/modules/node/node.module index 0453b3226ea58ec69f727b92d38c1a562ccf7a27..a81815682c6d1865bfe1f26b6eea62b98be6f69d 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -416,7 +416,6 @@ function node_type_save($info) { 'body_label' => (string) $type->body_label, 'description' => (string) $type->description, 'help' => (string) $type->help, - 'min_word_count' => (int) $type->min_word_count, 'custom' => (int) $type->custom, 'modified' => (int) $type->modified, 'locked' => (int) $type->locked, @@ -611,7 +610,6 @@ function node_type_set_defaults($info = array()) { $type->base = ''; $type->description = ''; $type->help = ''; - $type->min_word_count = 0; $type->has_title = 1; $type->has_body = 1; $type->title_label = t('Title'); @@ -860,13 +858,6 @@ function node_validate($node, $form = array()) { $node = (object)$node; $type = node_type_get_type($node); - // Make sure the body has the minimum number of words. - // TODO : use a better word counting algorithm that will work in other languages - if (!empty($type->min_word_count) && isset($node->body[0]['value']) && count(explode(' ', $node->body[0]['value'])) < $type->min_word_count) { - // TODO: Use Field API to set this error. - form_set_error('body', t('The body of your @type is too short. You need at least %words words.', array('%words' => $type->min_word_count, '@type' => $type->name))); - } - if (isset($node->nid) && (node_last_changed($node->nid) > $node->changed)) { form_set_error('changed', t('The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.')); } diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index f04c99ec0f62f1fd682ac38b512b4b42a15fcf58..591224b7cce31f2ef8dc4de3c8023e051ad03cfa 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -750,7 +750,6 @@ protected function drupalCreateContentType($settings = array()) { 'name' => $name, 'description' => '', 'help' => '', - 'min_word_count' => 0, 'title_label' => 'Title', 'body_label' => 'Body', 'has_title' => 1,