Commit 7a3827b4 authored by catch's avatar catch
Browse files

Issue #1477704 by kika, kid_icarus, andypost: Fixed Replace 'Selected'...

Issue #1477704 by kika, kid_icarus, andypost: Fixed Replace 'Selected' dropdown with checkbox in category edit form.
parent 42e17a14
...@@ -112,14 +112,9 @@ function contact_category_edit_form($form, &$form_state, array $category = array ...@@ -112,14 +112,9 @@ function contact_category_edit_form($form, &$form_state, array $category = array
'#description' => t('When listing categories, those with lighter (smaller) weights get listed before categories with heavier (larger) weights. Categories with equal weights are sorted alphabetically.'), '#description' => t('When listing categories, those with lighter (smaller) weights get listed before categories with heavier (larger) weights. Categories with equal weights are sorted alphabetically.'),
); );
$form['selected'] = array( $form['selected'] = array(
'#type' => 'select', '#type' => 'checkbox',
'#title' => t('Selected'), '#title' => t('Make this the default category.'),
'#options' => array(
0 => t('No'),
1 => t('Yes'),
),
'#default_value' => $category['selected'], '#default_value' => $category['selected'],
'#description' => t('Set this to <em>Yes</em> if you would like this category to be selected by default.'),
); );
$form['cid'] = array( $form['cid'] = array(
'#type' => 'value', '#type' => 'value',
......
...@@ -221,7 +221,7 @@ class ContactSitewideTestCase extends WebTestBase { ...@@ -221,7 +221,7 @@ class ContactSitewideTestCase extends WebTestBase {
$edit['category'] = $category; $edit['category'] = $category;
$edit['recipients'] = $recipients; $edit['recipients'] = $recipients;
$edit['reply'] = $reply; $edit['reply'] = $reply;
$edit['selected'] = ($selected ? '1' : '0'); $edit['selected'] = ($selected ? TRUE : FALSE);
$this->drupalPost('admin/structure/contact/add', $edit, t('Save')); $this->drupalPost('admin/structure/contact/add', $edit, t('Save'));
} }
...@@ -244,7 +244,7 @@ class ContactSitewideTestCase extends WebTestBase { ...@@ -244,7 +244,7 @@ class ContactSitewideTestCase extends WebTestBase {
$edit['category'] = $category; $edit['category'] = $category;
$edit['recipients'] = $recipients; $edit['recipients'] = $recipients;
$edit['reply'] = $reply; $edit['reply'] = $reply;
$edit['selected'] = ($selected ? '1' : '0'); $edit['selected'] = ($selected ? TRUE : FALSE);
$this->drupalPost('admin/structure/contact/edit/' . $category_id, $edit, t('Save')); $this->drupalPost('admin/structure/contact/edit/' . $category_id, $edit, t('Save'));
return ($category_id); return ($category_id);
} }
......
...@@ -1177,9 +1177,9 @@ protected function drupalGetAJAX($path, array $options = array(), array $headers ...@@ -1177,9 +1177,9 @@ protected function drupalGetAJAX($path, array $options = array(), array $headers
* @param $edit * @param $edit
* Field data in an associative array. Changes the current input fields * Field data in an associative array. Changes the current input fields
* (where possible) to the values indicated. A checkbox can be set to * (where possible) to the values indicated. A checkbox can be set to
* TRUE to be checked and FALSE to be unchecked. Note that when a form * TRUE to be checked and should be set to FALSE to be unchecked. Note that
* contains file upload fields, other fields cannot start with the '@' * when a form contains file upload fields, other fields cannot start with
* character. * the '@' character.
* *
* Multiple select fields can be set using name[] and setting each of the * Multiple select fields can be set using name[] and setting each of the
* possible values. Example: * possible values. Example:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment