mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Try to fix some of the Component code (#9888)
https://community.librenms.org/t/devices-list-stuck-at-loading/7396
This commit is contained in:
@@ -154,16 +154,17 @@ class Component
|
||||
|
||||
// Populate our reserved fields into the Array, these cant be used as user attributes.
|
||||
foreach ($COMPONENTS as $COMPONENT) {
|
||||
$component_device_id = (int)$COMPONENT['device_id'];
|
||||
foreach ($this->reserved as $k => $v) {
|
||||
$RESULT[$COMPONENT['device_id']][$COMPONENT['id']][$k] = $COMPONENT[$k];
|
||||
$RESULT[$component_device_id][$COMPONENT['id']][$k] = $COMPONENT[$k];
|
||||
}
|
||||
|
||||
// Sort each component array so the attributes are in order.
|
||||
if (is_array($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]])) {
|
||||
ksort($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]]);
|
||||
if (is_array($RESULT[$RESULT[$component_device_id][$COMPONENT['id']]])) {
|
||||
ksort($RESULT[$RESULT[$component_device_id][$COMPONENT['id']]]);
|
||||
}
|
||||
if (is_array($RESULT[$RESULT[$COMPONENT['device_id']]])) {
|
||||
ksort($RESULT[$RESULT[$COMPONENT['device_id']]]);
|
||||
if (is_array($RESULT[$RESULT[$component_device_id]])) {
|
||||
ksort($RESULT[$RESULT[$component_device_id]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user