--- ../tmp/drupal8.form-radio-default-test-1381140-41.patch 2013-03-16 12:09:46.000000000 -0700 +++ ../tmp/1381140.patch 2013-10-24 13:19:06.070813539 -0700 @@ -1,21 +1,8 @@ -From ac3390a843881766456b19d6b0fddc87878ef772 Mon Sep 17 00:00:00 2001 -From: babruix -Date: Sat, 16 Mar 2013 20:10:11 +0100 -Subject: [PATCH] Issue #1381140 by sun: Fixed #default_value = 0 for #type - radios checks all radios. - ---- - core/includes/form.inc | 5 +++++ - .../lib/Drupal/simpletest/WebTestBase.php | 1 + - .../lib/Drupal/system/Tests/Form/ElementTest.php | 6 ++++++ - .../tests/modules/form_test/form_test.module | 24 ++++++++++++++++++++++ - 4 files changed, 36 insertions(+) - diff --git a/core/includes/form.inc b/core/includes/form.inc -index 27f450e..1ae8112 100644 +index 63f1de9..a1356b9 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc -@@ -3568,6 +3568,11 @@ function form_process_tableselect($element) { +@@ -3573,6 +3573,11 @@ function form_process_tableselect($element) { // Do not overwrite manually created children. if (!isset($element[$key])) { if ($element['#multiple']) { @@ -28,10 +15,10 @@ if (!empty($element['#options'][$key]['title']['data']['#title'])) { $title = t('Update @title', array( diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php -index 9e8b097..ae76e95 100644 +index 3da3e93..cfb9c86 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php -@@ -2797,6 +2797,7 @@ protected function assertNoFieldById($id, $value = '', $message = '', $group = ' +@@ -3130,6 +3130,7 @@ protected function assertNoFieldById($id, $value = '', $message = '', $group = ' */ protected function assertFieldChecked($id, $message = '', $group = 'Browser') { $elements = $this->xpath('//input[@id=:id]', array(':id' => $id)); @@ -40,7 +27,7 @@ } diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php -index e3521cc..9530ac4 100644 +index c491d0e..094df6b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php @@ -91,6 +91,12 @@ function testOptions() { @@ -57,28 +44,374 @@ /** diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module -index c7a85a3..467fc48 100644 +index a3d1cd0..a3ef934 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module -@@ -204,6 +204,12 @@ function form_test_menu() { - 'page arguments' => array('form_test_checkboxes_radios'), - 'access callback' => TRUE, - ); +@@ -15,6 +15,358 @@ + use Symfony\Component\HttpFoundation\JsonResponse; + + /** ++ * Implements hook_menu(). ++ */ ++function form_test_menu() { ++ $items['form-test/alter'] = array( ++ 'title' => 'Form altering test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_alter_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/validate'] = array( ++ 'title' => 'Form validation handlers test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_validate_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/system-config-form'] = array( ++ 'title' => 'Form object builder test', ++ 'page callback' => 'NOT_USED', ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/validate-required'] = array( ++ 'title' => 'Form #required validation', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_validate_required_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/validate-required-no-title'] = array( ++ 'title' => 'Form #required validation without #title', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_validate_required_form_no_title'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/limit-validation-errors'] = array( ++ 'title' => 'Form validation with some error suppression', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_limit_validation_errors_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/pattern'] = array( ++ 'title' => 'Pattern validation', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_pattern_form'), ++ 'access callback' => TRUE, ++ ); ++ ++ $items['form_test/tableselect/multiple-true'] = array( ++ 'title' => 'Tableselect checkboxes test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_tableselect_multiple_true_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form_test/tableselect/multiple-false'] = array( ++ 'title' => 'Tableselect radio button test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_tableselect_multiple_false_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form_test/tableselect/colspan'] = array( ++ 'title' => 'Tableselect colspan test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_tableselect_colspan_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form_test/tableselect/empty-text'] = array( ++ 'title' => 'Tableselect empty text test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_tableselect_empty_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form_test/tableselect/advanced-select'] = array( ++ 'title' => 'Tableselect js_select tests', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_tableselect_js_select_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form_test/vertical-tabs'] = array( ++ 'title' => 'Vertical tabs tests', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_vertical_tabs_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form_test/form-storage'] = array( ++ 'title' => 'Form storage test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_storage_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form_test/wrapper-callback'] = array( ++ 'title' => 'Form wrapper callback test', ++ 'page callback' => 'form_test_wrapper_callback', ++ 'page arguments' => array('form_test_wrapper_callback_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form_test/form-state-values-clean'] = array( ++ 'title' => 'Form state values clearance test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_form_state_values_clean_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form_test/form-state-values-clean-advanced'] = array( ++ 'title' => 'Form state values clearance advanced test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_form_state_values_clean_advanced_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/checkbox'] = array( ++ 'title' => t('Form test'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_checkbox'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/select'] = array( ++ 'title' => t('Select'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_select'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/empty-select'] = array( ++ 'title' => 'Empty Select Element', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_empty_select'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/language_select'] = array( ++ 'title' => t('Language Select'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_language_select'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/placeholder-text'] = array( ++ 'title' => 'Placeholder', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_placeholder_test'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/number'] = array( ++ 'title' => 'Number', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_number'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/number/range'] = array( ++ 'title' => 'Range', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_number', 'range'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/range']= array( ++ 'title' => 'Range', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_range'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/range/invalid'] = array( ++ 'title' => 'Invalid range', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_range_invalid'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/color'] = array( ++ 'title' => 'Color', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_color'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/checkboxes-radios'] = array( ++ 'title' => t('Checkboxes, Radios'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_checkboxes_radios'), ++ 'access callback' => TRUE, ++ ); + $items['form-test/radios-default-value-checks-all'] = array( + 'title' => 'Radios default_value Checks All', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('form_test_radios_default_value_checks_all'), + 'access callback' => TRUE, + ); - $items['form-test/email'] = array( - 'title' => 'E-Mail fields', - 'page callback' => 'drupal_get_form', -@@ -1632,6 +1638,24 @@ function form_test_checkboxes_radios($form, &$form_state, $customize = FALSE) { ++ $items['form-test/email'] = array( ++ 'title' => 'E-Mail fields', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_email'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/url'] = array( ++ 'title' => t('URL'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_url'), ++ 'access callback' => TRUE, ++ ); ++ ++ $items['form-test/disabled-elements'] = array( ++ 'title' => t('Form test'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_disabled_elements'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/input-forgery'] = array( ++ 'title' => t('Form test'), ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('_form_test_input_forgery'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/form-rebuild-preserve-values'] = array( ++ 'title' => 'Form values preservation during rebuild test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_form_rebuild_preserve_values_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/redirect'] = array( ++ 'title' => 'Redirect test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_redirect'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form_test/form-labels'] = array( ++ 'title' => 'Form label test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_label_test_form'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/state-persist'] = array( ++ 'title' => 'Form state persistence without storage', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_state_persist'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/clicked-button'] = array( ++ 'title' => 'Clicked button test', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_clicked_button'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ if (module_exists('node')) { ++ $items['form-test/two-instances-of-same-form'] = array( ++ 'title' => 'AJAX test with two form instances', ++ 'page callback' => 'form_test_two_instances', ++ 'access callback' => 'node_access', ++ 'access arguments' => array('create', 'page'), ++ 'file path' => drupal_get_path('module', 'node'), ++ 'file' => 'node.pages.inc', ++ 'type' => MENU_CALLBACK, ++ ); ++ } ++ $items['form-test/double-form'] = array( ++ 'title' => 'Double form test', ++ 'page callback' => 'form_test_double_form', ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/load-include-menu'] = array( ++ 'title' => 'FAPI test loading includes', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_load_include_menu'), ++ 'access callback' => TRUE, ++ 'file' => 'form_test.file.inc', ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/load-include-custom'] = array( ++ 'title' => 'FAPI test loading includes', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_load_include_custom'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ $items['form-test/checkboxes-zero'] = array( ++ 'title' => 'FAPI test involving checkboxes and zero', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_checkboxes_zero'), ++ 'access callback' => TRUE, ++ 'type' => MENU_CALLBACK, ++ ); ++ ++ $items['form-test/required-attribute'] = array( ++ 'title' => 'Required', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_required_attribute'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/button-class'] = array( ++ 'title' => 'Button class testing', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_button_class'), ++ 'access callback' => TRUE, ++ ); ++ ++ $items['form-test/group-details'] = array( ++ 'title' => 'Group details testing', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_group_details'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/group-container'] = array( ++ 'title' => 'Group container testing', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_group_container'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/group-fieldset'] = array( ++ 'title' => 'Group fieldset testing', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_group_fieldset'), ++ 'access callback' => TRUE, ++ ); ++ $items['form-test/group-vertical-tabs'] = array( ++ 'title' => 'Group vertical tabs testing', ++ 'page callback' => 'drupal_get_form', ++ 'page arguments' => array('form_test_group_vertical_tabs'), ++ 'access callback' => TRUE, ++ ); ++ ++ return $items; ++} ++ ++/** + * Implements hook_permission(). + */ + function form_test_permission() { +@@ -1358,6 +1710,24 @@ function form_test_checkboxes_radios($form, &$form_state, $customize = FALSE) { return $form; } +/** -+ * Form constructor for testing whether settings a '#default_value' => 0 in ++ * Form constructor for testing whether settings a '#default_value' => 0 in + * a set of radio button #options using string keys checks all options. + * @ingroup forms + */ @@ -98,6 +431,3 @@ /** * Form constructor for testing #type 'email' elements. --- -1.7.12.4 (Apple Git-37) -