sort arrays before storing them in a component (#10329)

This commit is contained in:
VVelox
2019-06-11 07:52:42 -05:00
committed by Tony Murray
parent 1ae77dfb70
commit d071c8b403
3 changed files with 10 additions and 1 deletions
@@ -149,6 +149,9 @@ if (empty($ports_keys)) {
$portsc = $component->createComponent($device_id, 'portsactivity');
}
// Make sure we don't readd it, just in a different order.
sort($ports_keys);
$id = $component->getFirstComponentID($portsc);
$portsc[$id]['label'] = 'Portsactivity';
$portsc[$id]['ports'] = json_encode($ports_keys);
@@ -128,6 +128,9 @@ if (empty($found_dbs)) {
$pgc = $component->createComponent($device_id, 'postgres');
}
// Make sure we don't readd it, just in a different order.
sort($found_dbs);
$id = $component->getFirstComponentID($pgc);
$pgc[$id]['label'] = 'Postgres';
$pgc[$id]['databases'] = json_encode($found_dbs);
+4 -1
View File
@@ -9,7 +9,7 @@ $app_id = $app['app_id'];
echo $name;
// Is set to false later if missing keys are found.
// Is set to false later if missing keys are found.
$not_legacy=1;
try {
@@ -205,6 +205,9 @@ if (empty($pools)) {
$zfsc = $component->createComponent($device_id, 'zfs');
}
// Make sure we don't readd it, just in a different order.
sort($pools);
$id = $component->getFirstComponentID($zfsc);
$zfsc[$id]['label'] = 'ZFS';
$zfsc[$id]['pools'] = json_encode($pools);