🚑 fix(ObjectSelectAttribute) Fix support of PHP<7.3

array_push requires at least 2 attributes in PHP<7.3

issue #6083
parent 30c39b5e
......@@ -71,8 +71,12 @@ class ObjectSelectAttribute extends SelectAttribute
$realDisplayAttr => (($realDisplayAttr == 'dn') ? 'raw' : '1'),
];
$objects = objects::ls($objectType, $attributes, NULL, $this->objectFilter);
array_push($choices, ...array_column($objects, $realStoreAttr));
array_push($outputs, ...array_column($objects, $realDisplayAttr));
foreach (array_column($objects, $realStoreAttr) as $choice) {
$choices[] = $choice;
}
foreach (array_column($objects, $realDisplayAttr) as $output) {
$outputs[] = $output;
}
} catch (NonExistingObjectTypeException $e) {
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment