mvc, store value="0" issue

This commit is contained in:
Ad Schellevis 2017-09-20 19:16:47 +02:00
parent 020010fb1f
commit 60b0b2633e
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ abstract class BaseModel
$result = array();
foreach ($xmlNode->children() as $childNode) {
// item keys can be overwritten using value attributes
if (empty($childNode->attributes()['value'])) {
if (!isset($childNode->attributes()['value'])) {
$itemKey = (string)$childNode->getName();
} else {
$itemKey = (string)$childNode->attributes()['value'];

View File

@ -84,7 +84,7 @@ class OptionField extends BaseField
// copy options to internal structure, make sure we don't copy in array structures
foreach ($data as $key => $value) {
if (!is_array($value)) {
if ($key == "__empty__") {
if ($key === "__empty__") {
$this->internalOptionList[""] = $value;
} else {
$this->internalOptionList[$key] = $value;