bug in hub/location sync

This commit is contained in:
redmatrix 2015-11-02 21:02:30 -08:00
parent 0998ef0c4e
commit d13dae6b06

View File

@ -2364,16 +2364,15 @@ function sync_locations($sender, $arr, $absolute = false) {
$changed = true;
}
}
if((intval($r[0]['hubloc_deleted']) && (! $location['deleted']))
|| ((! (intval($r[0]['hubloc_deleted']))) && ($location['deleted']))) {
if(intval($r[0]['hubloc_deleted']) && (! intval($location['deleted']))) {
$n = q("update hubloc set hubloc_deleted = 0, hubloc_updated = '%s' where hubloc_id = %d",
dbesc(datetime_convert()),
intval($r[0]['hubloc_id'])
);
$what .= 'delete_hub ';
$what .= 'undelete_hub ';
$changed = true;
}
elseif((! intval($r[0]['hubloc_deleted'])) && ($location['deleted'])) {
elseif((! intval($r[0]['hubloc_deleted'])) && (intval($location['deleted']))) {
$n = q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id = %d",
dbesc(datetime_convert()),
intval($r[0]['hubloc_id'])