MVC, php union operator seems to be bugggy, closes https://github.com/opnsense/core/pull/3301

This commit is contained in:
Ad Schellevis 2019-03-11 09:25:51 +01:00
parent fbf5bf723c
commit 3cff50bc2f

View File

@ -211,7 +211,12 @@ class ModelRelationField extends BaseField
$datanodes = explode(',', $this->internalValue);
if ($this->internalIsSorted) {
$optKeys = $datanodes + array_keys(self::$internalOptionList[$this->internalCacheKey]);
$optKeys = $datanodes;
foreach (array_keys(self::$internalOptionList[$this->internalCacheKey]) as $key) {
if (!in_array($key, $optKeys)) {
$optKeys[] = $key;
}
}
} else {
$optKeys = array_keys(self::$internalOptionList[$this->internalCacheKey]);
}