Merge pull request #876 from HARVS1789UK/hotfix/5.4.1

Prevent 'undefined index' warnings with optional country dropdowns
This commit is contained in:
Dylan Wagstaff 2019-05-01 14:28:16 +12:00 committed by GitHub
commit 88215b9efb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ class EditableCountryDropdownField extends EditableFormField
public function getValueFromData($data) public function getValueFromData($data)
{ {
if (isset($data[$this->Name])) { if (!empty($data[$this->Name])) {
$source = $this->getFormField()->getSource(); $source = $this->getFormField()->getSource();
return $source[$data[$this->Name]]; return $source[$data[$this->Name]];
} }