From 404ebd4d5e7a04f3e3a48bcf95b80774a96a4344 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 4 Oct 2021 13:31:26 +0200 Subject: app sync fixes - part 2 --- include/import.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/import.php b/include/import.php index 3bd2af4ce..c986eeaef 100644 --- a/include/import.php +++ b/include/import.php @@ -590,7 +590,7 @@ function import_sysapps($channel, $apps) { */ function sync_sysapps($channel, $apps) { - $sysapps = Apps::get_system_apps(false); + $sysapps = Apps::get_system_apps(false, true); if ($channel && $apps) { @@ -606,7 +606,8 @@ 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", dbesc($app['app_id']), @@ -617,13 +618,12 @@ function sync_sysapps($channel, $apps) { // install this app on this server $newapp = $sysapp; $newapp['uid'] = $channel['channel_id']; - $newapp['guid'] = hash('whirlpool',$newapp['name']); - + $newapp['guid'] = hash('whirlpool', $newapp['name']); $newapp['system'] = 1; if ($term) { - $newapp['categories'] = array_elm_to_str($term,'term'); + $newapp['categories'] = array_elm_to_str($term, 'term'); } - Apps::app_install($channel['channel_id'],$newapp); + Apps::app_install($channel['channel_id'], $newapp); } } } -- cgit v1.2.3