? .htaccess
? drushrc.php
? process-with-test.patch
? process.patch
? sites
Index: modules/field/modules/list/list.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.module,v
retrieving revision 1.34
diff -u -p -r1.34 list.module
--- modules/field/modules/list/list.module	4 Sep 2010 15:40:51 -0000	1.34
+++ modules/field/modules/list/list.module	29 Sep 2010 21:00:18 -0000
@@ -88,6 +88,7 @@ function list_field_settings_form($field
       '#description' => '',
       '#input' => TRUE,
       '#value_callback' => 'list_boolean_allowed_values_callback',
+      '#process' => array('list_boolean_disable_onoff_elements'),
       '#access' => empty($settings['allowed_values_function']),
     );
     $form['allowed_values']['on'] = array(
@@ -166,6 +167,20 @@ function list_boolean_allowed_values_cal
 }
 
 /**
+ * Form element #process callback: disable on/off during input processing.
+ *
+ * This must be done conditionally because doing it always disables the default
+ * value handling and the current value doesn't show up.
+ */
+function list_boolean_disable_onoff_elements($element, $form_state) {
+  if (!empty($form_state['process_input'])) {
+    $element['on']['#input'] = FALSE;
+    $element['off']['#input'] = FALSE;
+  }
+  return $element;
+}
+
+/**
  * Implements hook_field_update_field().
  */
 function list_field_update_field($field, $prior_field, $has_data) {
Index: modules/field/modules/list/tests/list.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/list/tests/list.test,v
retrieving revision 1.7
diff -u -p -r1.7 list.test
--- modules/field/modules/list/tests/list.test	5 Aug 2010 23:53:37 -0000	1.7
+++ modules/field/modules/list/tests/list.test	29 Sep 2010 21:00:18 -0000
@@ -134,26 +134,37 @@ class ListFieldUITestCase extends FieldT
   function testAllowedValues() {
     $element_name = "field[settings][allowed_values]";
 
-    //Test 'List' field type.
+    // Test 'List' field type.
     $admin_path = $this->createListFieldAndEdit('list');
-    //Check that non-integer keys are rejected.
+    // Check that non-integer keys are rejected.
     $edit = array($element_name => "1.1|one\n");
     $this->drupalPost($admin_path, $edit, t('Save settings'));
     $this->assertText("keys must be integers", t('Form validation failed.'));
 
     // Test 'List (number)' field type.
     $admin_path = $this->createListFieldAndEdit('list_number');
-    //Check that non-numeric keys are rejected.
+    // Check that non-numeric keys are rejected.
     $edit = array($element_name => "1|one\nB|two");
     $this->drupalPost($admin_path, $edit, t('Save settings'));
     $this->assertText("each key must be a valid integer or decimal", t('Form validation failed.'));
 
-    //Test 'List (text)' field type.
+    // Test 'List (text)' field type.
     $admin_path = $this->createListFieldAndEdit('list_text');
-    //Check that over long keys are rejected.
+    // Check that over long keys are rejected.
     $edit = array($element_name => "1|one\n" . $this->randomName(256) . "|two");
     $this->drupalPost($admin_path, $edit, t('Save settings'));
     $this->assertText("each key must be a string at most 255 characters long", t('Form validation failed.'));
+
+    // Test 'Boolean' field type.
+    $admin_path = $this->createListFieldAndEdit('list_boolean');
+    // Check that the seperate 'On' and 'Off' form fields work.
+    $edit = array(
+      $element_name . '[on]' => $this->randomName(),
+      $element_name . '[off]' => $this->randomName(),
+    );
+    $this->drupalPost($admin_path, $edit, t('Save settings'));
+    $this->assertText("Saved test_list_boolean configuration.", t("The 'On' and 'Off' form fields work for boolean fields."));
+    
   }
 
   /**
