Skip to content

Commit 813a475

Browse files
committed
chg: [internal] Allow to have empty nationality
1 parent 7aa9101 commit 813a475

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/Controller/OrganisationsController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ public function admin_add()
159159
}
160160
}
161161
}
162-
$this->set('countries', $this->_arrayToValuesIndexArray($this->Organisation->getCountries()));
162+
$countries = array_merge(['' => __('Not specified')], $this->_arrayToValuesIndexArray($this->Organisation->getCountries()));
163+
$this->set('countries', $countries);
163164
}
164165

165166
public function admin_edit($id)
@@ -238,7 +239,7 @@ public function admin_edit($id)
238239
$this->request->data = $this->Organisation->data;
239240
}
240241

241-
$countries = $this->_arrayToValuesIndexArray($this->Organisation->getCountries());
242+
$countries = array_merge(['' => __('Not specified')], $this->_arrayToValuesIndexArray($this->Organisation->getCountries()));
242243
if (!empty($this->Organisation->data['Organisation']['nationality'])) {
243244
$currentCountry = $this->Organisation->data['Organisation']['nationality'];
244245
if (!isset($countries[$currentCountry])) {

app/Model/Organisation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function beforeValidate($options = array())
104104
}
105105
$this->data['Organisation']['date_modified'] = $date;
106106
if (!isset($this->data['Organisation']['nationality']) || empty($this->data['Organisation']['nationality'])) {
107-
$this->data['Organisation']['nationality'] = 'Not specified';
107+
$this->data['Organisation']['nationality'] = '';
108108
}
109109
return true;
110110
}

0 commit comments

Comments
 (0)