From e3c2e39b7a5a2edda069ef037dcfa31f4f75d7d9 Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 17 Mar 2022 18:40:15 -0700 Subject: [PATCH 1/2] fix app sync --- include/import.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/import.php b/include/import.php index f332267ad..f95b103f7 100644 --- a/include/import.php +++ b/include/import.php @@ -764,6 +764,7 @@ function import_sysapps($channel, $apps) $sysapps = Apps::get_system_apps(false); foreach ($apps as $app) { + if (array_key_exists('app_system', $app) && (! intval($app['app_system']))) { continue; } @@ -775,7 +776,7 @@ function import_sysapps($channel, $apps) $term = ((array_key_exists('term', $app) && is_array($app['term'])) ? $app['term'] : null); foreach ($sysapps as $sysapp) { - if ($app['app_id'] === hash('whirlpool', $sysapp['app_name'])) { + if ($app['app_id'] === hash('whirlpool', $sysapp['name'])) { // install this app on this server $newapp = $sysapp; $newapp['uid'] = $channel['channel_id']; @@ -811,7 +812,7 @@ function sync_sysapps($channel, $apps) { $sysapps = Apps::get_system_apps(false); - + if ($channel && $apps) { $columns = db_columns('app'); @@ -824,7 +825,7 @@ function sync_sysapps($channel, $apps) } foreach ($sysapps as $sysapp) { - if ($app['app_id'] === hash('whirlpool', $sysapp['app_name'])) { + if ($app['app_id'] === hash('whirlpool', $sysapp['name'])) { if (array_key_exists('app_deleted', $app) && $app['app_deleted'] && $app['app_id']) { q( "update app set app_deleted = 1 where app_id = '%s' and app_channel = %d", From 60e73c01ac1f48ff5d503d6a6c6c5dcf10b9de9f Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 17 Mar 2022 19:26:10 -0700 Subject: [PATCH 2/2] task sync --- Code/Lib/Libsync.php | 2 +- Code/Module/Tasks.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Code/Lib/Libsync.php b/Code/Lib/Libsync.php index 5277bc62a..d112f55b6 100644 --- a/Code/Lib/Libsync.php +++ b/Code/Lib/Libsync.php @@ -33,7 +33,7 @@ class Libsync public static function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { - //logger('build_sync_packet'); + // logger('build_sync_packet'); $keychange = (($packet && array_key_exists('keychange', $packet)) ? true : false); if ($keychange) { diff --git a/Code/Module/Tasks.php b/Code/Module/Tasks.php index bd95c3cb6..3650f039c 100644 --- a/Code/Module/Tasks.php +++ b/Code/Module/Tasks.php @@ -4,6 +4,7 @@ namespace Code\Module; use App; use Code\Web\Controller; +use Code\Lib\Libsync; use Code\Lib\Apps; use Code\Widget\Tasklist; @@ -70,6 +71,7 @@ class Tasks extends Controller } $x = event_store_event($event); if ($x) { + Libsync::build_sync_packet($channel['channel_id'], ['event' => [$x]]); $ret['success'] = true; } } @@ -93,10 +95,13 @@ class Tasks extends Controller $event['summary'] = escape_tags($_REQUEST['summary']); $x = event_store_event($event); if ($x) { + Libsync::build_sync_packet($channel['channel_id'], ['event' => [$x]]); $x['success'] = true; - } else { + } + else { $x = ['success' => false]; } + json_return_and_die($x); } }