Skip to content

Commit 0c76372

Browse files
committed
QA: Fix upstream issue with branch call
1 parent 2e272b5 commit 0c76372

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/auth.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,12 +907,15 @@ function is_tree_branch_empty($tree_id, $parent = 0) {
907907
), 'site_id', 'site_id'
908908
);
909909

910+
$total_rows = -1;
911+
910912
if (!cacti_sizeof($sites)) {
911-
if (cacti_sizeof($hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $hosts) . ')'), 'description', '', -1) > 0) {
913+
if (cacti_sizeof($hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $hosts) . ')', 'description', '', $total_rows)) > 0) {
912914
return false;
913915
}
914916
} else {
915917
$site_hosts = array();
918+
916919
foreach($sites as $site) {
917920
$site_hosts += array_rekey(
918921
db_fetch_assoc_prepared('SELECT id
@@ -923,7 +926,7 @@ function is_tree_branch_empty($tree_id, $parent = 0) {
923926
);
924927
}
925928

926-
if (cacti_sizeof($site_hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $site_hosts) . ')'), 'description', '', -1) > 0) {
929+
if (cacti_sizeof($site_hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $site_hosts) . ')', 'description', '', $total_rows)) > 0) {
927930
return false;
928931
}
929932
}

0 commit comments

Comments
 (0)