fix "deleted hubloc after cloning"

This commit is contained in:
Mike Macgirvin 2022-11-28 20:49:47 +11:00
parent 79b88c3927
commit 3548305e68

View file

@ -461,10 +461,8 @@ function import_hublocs($channel, $hublocs, $seize)
$hubloc['hubloc_primary'] = 0;
}
if (($x = Libzot::gethub($arr)) === false) {
unset($hubloc['hubloc_id']);
hubloc_store_lowlevel($hubloc);
} else {
$x = Libzot::gethub($arr);
if ($x) {
q(
"UPDATE hubloc set hubloc_primary = %d, hubloc_deleted = %d where hubloc_id = %d",
intval($hubloc['hubloc_primary']),
@ -472,6 +470,10 @@ function import_hublocs($channel, $hublocs, $seize)
intval($x['hubloc_id'])
);
}
else {
unset($hubloc['hubloc_id']);
hubloc_store_lowlevel($hubloc);
}
}
}
}