From d13dae6b060ad1147426ae88791cac5970ab3b03 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 2 Nov 2015 21:02:30 -0800 Subject: bug in hub/location sync --- include/zot.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index f8b8ba43f..b13111f04 100644 --- a/include/zot.php +++ b/include/zot.php @@ -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']) -- cgit v1.2.3