summaryrefslogtreecommitdiffstats
path: root/library/Director/DirectorObject/Automation/CompareBasketObject.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:47 +0000
commit5419d4428c86c488a43124f85e5407d7cbae6541 (patch)
tree772c4221a20fd7d1b3e7e67c6e21755a50e80fd7 /library/Director/DirectorObject/Automation/CompareBasketObject.php
parentAdding upstream version 1.10.2. (diff)
downloadicingaweb2-module-director-5419d4428c86c488a43124f85e5407d7cbae6541.tar.xz
icingaweb2-module-director-5419d4428c86c488a43124f85e5407d7cbae6541.zip
Adding upstream version 1.11.1.upstream/1.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--library/Director/DirectorObject/Automation/CompareBasketObject.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/Director/DirectorObject/Automation/CompareBasketObject.php b/library/Director/DirectorObject/Automation/CompareBasketObject.php
index ef2e9e2..f1ab6a9 100644
--- a/library/Director/DirectorObject/Automation/CompareBasketObject.php
+++ b/library/Director/DirectorObject/Automation/CompareBasketObject.php
@@ -31,7 +31,7 @@ class CompareBasketObject
static::normalize($v);
}
unset($v);
- $value = $sorted;
+ $value = (object) $sorted;
// foreign baskets might not sort those lists correctly:
if (isset($value->list_name) && isset($value->entries)) {
@@ -46,7 +46,11 @@ class CompareBasketObject
protected static function sortListBy($key, &$list)
{
usort($list, function ($a, $b) use ($key) {
- return $a->$key > $b->$key ? -1 : 1;
+ if (is_array($a)) {
+ return $a[$key] > $b[$key] ? -1 : 1;
+ } else {
+ return $a->$key > $b->$key ? -1 : 1;
+ }
});
}