Skip to content

Commit

Permalink
Set 'None' select option values to empty string instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jensschuppe committed Apr 3, 2020
1 parent 7222d5f commit f304f4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CRM/Admin/Form/Mutualaid.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function buildQuickForm()
array(
'text' => E::ts('- None -'),
'attr' => array(
'value' => 0,
'value' => '',
),
)
);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Mutualaid/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function addContactFormFields()
case 'suffix_id':
$options = array();
if (!$required) {
$options[0] = E::ts('- None -');
$options[''] = E::ts('- None -');
}
$options += CRM_Contact_BAO_Contact::buildOptions(
$field_name
Expand Down
6 changes: 3 additions & 3 deletions CRM/Mutualaid/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public static function getCountries($include_none = true)
{
$countries = array();
if ($include_none) {
$countries[0] = E::ts('- None -');
$countries[''] = E::ts('- None -');
}
$countries += CRM_Admin_Form_Setting_Localization::getAvailableCountries();

Expand All @@ -307,7 +307,7 @@ public static function getStateProvinces($country_id = null, $include_none = tru
{
$state_provinces = array();
if ($include_none) {
$state_provinces[0] = E::ts('- None -');
$state_provinces[''] = E::ts('- None -');
}

if (!isset($country_id)) {
Expand All @@ -329,7 +329,7 @@ public static function getCounties($state_province_id = null, $include_none = tr
{
$counties = array();
if ($include_none) {
$counties[0] = E::ts('- None -');
$counties[''] = E::ts('- None -');
}

if (!isset($state_province_id)) {
Expand Down

1 comment on commit f304f4c

@jensschuppe
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Belongs to issue #21.

Please sign in to comment.