From b099dc2fc97d8689e5e5e46a3abe1679693d4e3d Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Wed, 20 May 2020 16:57:44 +0200 Subject: [PATCH 1/2] Use new function getResidentRackIDs instead of getResidentRacksData getResidentRacksData has been removed in Racktables 0.21.1 --- wwwroot/api.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wwwroot/api.php b/wwwroot/api.php index 0f2e7d0ed..3f89db30c 100644 --- a/wwwroot/api.php +++ b/wwwroot/api.php @@ -247,7 +247,13 @@ assertUIntArg ("object_id", TRUE); // get physical allocations - $racksData = getResidentRacksData ($_REQUEST['object_id']); + $racksData = array(); + foreach (getResidentRackIDs ($_REQUEST['object_id']) as $rack_id) + { + $rackData = spotEntity ('rack', $rack_id); + amplifyCell ($rackData); + $racksData[$rack_id] = $rackData; + } // get zero-U allocations $zeroURacks = array(); @@ -292,7 +298,7 @@ // determine current "normal" allocations - foreach ( array_keys( getResidentRacksData ( $object_id ) ) as $rack_id ) + foreach ( getResidentRacksIDs ( $object_id ) as $rack_id ) { $allocationsOld[] = $rack_id; } @@ -672,7 +678,7 @@ } // Invalidate thumb cache of all racks objects could occupy. - foreach (getResidentRacksData ($object_id, FALSE) as $rack_id) + foreach (getResidentRacksIDs ($object_id) as $rack_id) usePreparedDeleteBlade ('RackThumbnail', array ('rack_id' => $rack_id)); // ok, now we're good @@ -943,7 +949,7 @@ assertUIntArg ('object_id'); // determine racks the object is in - $racklist = getResidentRacksData ($_REQUEST['object_id'], FALSE); + $racklist = getResidentRacksIDs ($_REQUEST['object_id']); commitDeleteObject ($_REQUEST['object_id']); foreach ($racklist as $rack_id) From 38dc724596ed223e014529d1efb28ea7159cb34a Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Mon, 25 May 2020 15:18:52 +0200 Subject: [PATCH 2/2] Fix typo in function name introduced by b099dc2f --- wwwroot/api.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wwwroot/api.php b/wwwroot/api.php index 3f89db30c..5ea45e4fa 100644 --- a/wwwroot/api.php +++ b/wwwroot/api.php @@ -298,7 +298,7 @@ // determine current "normal" allocations - foreach ( getResidentRacksIDs ( $object_id ) as $rack_id ) + foreach ( getResidentRackIDs ( $object_id ) as $rack_id ) { $allocationsOld[] = $rack_id; } @@ -678,7 +678,7 @@ } // Invalidate thumb cache of all racks objects could occupy. - foreach (getResidentRacksIDs ($object_id) as $rack_id) + foreach (getResidentRackIDs ($object_id) as $rack_id) usePreparedDeleteBlade ('RackThumbnail', array ('rack_id' => $rack_id)); // ok, now we're good @@ -949,7 +949,7 @@ assertUIntArg ('object_id'); // determine racks the object is in - $racklist = getResidentRacksIDs ($_REQUEST['object_id']); + $racklist = getResidentRackIDs ($_REQUEST['object_id']); commitDeleteObject ($_REQUEST['object_id']); foreach ($racklist as $rack_id)