diff options
author | Mario <mario@mariovavti.com> | 2020-12-14 22:06:47 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-12-14 22:06:47 +0000 |
commit | 4a902dbbbe79a59d6e434ddb39ff24af93583da3 (patch) | |
tree | a1eb6abb6e850149304ec3044f95026812083ddb | |
parent | 8e488e291347857407dbedaf05d63941701d82d2 (diff) | |
download | volse-hubzilla-4a902dbbbe79a59d6e434ddb39ff24af93583da3.tar.gz volse-hubzilla-4a902dbbbe79a59d6e434ddb39ff24af93583da3.tar.bz2 volse-hubzilla-4a902dbbbe79a59d6e434ddb39ff24af93583da3.zip |
fix file sync issues
-rw-r--r-- | Zotlabs/Module/Attach_edit.php | 2 | ||||
-rw-r--r-- | include/import.php | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Zotlabs/Module/Attach_edit.php b/Zotlabs/Module/Attach_edit.php index 667a0b7aa..5880d8f13 100644 --- a/Zotlabs/Module/Attach_edit.php +++ b/Zotlabs/Module/Attach_edit.php @@ -181,7 +181,7 @@ class Attach_edit extends Controller { } if (! $admin_delete && $actions_done) { - $sync = attach_export_data($channel, $resource, false); + $sync = attach_export_data($channel, $resource, (($delete) ? true : false)); if ($sync) { Libsync::build_sync_packet($channel_id, ['file' => [$sync]]); diff --git a/include/import.php b/include/import.php index eb3125a8e..cfbb8775d 100644 --- a/include/import.php +++ b/include/import.php @@ -1208,6 +1208,9 @@ function sync_files($channel, $files) { continue; } + $term = $att['term']; + unset($att['term']); + $attach_exists = false; $x = attach_by_hash($att['hash'],$channel['channel_hash']); logger('sync_files duplicate check: attach_exists=' . $attach_exists, LOGGER_DEBUG); @@ -1373,8 +1376,8 @@ function sync_files($channel, $files) { intval($a[0]['id']), intval(TERM_OBJ_FILE) ); - if($att['term']) { - foreach($att['term'] as $t) { + if($term) { + foreach($term as $t) { if(array_key_exists('type',$t)) $t['ttype'] = $t['type']; store_item_tag($channel['channel_id'], $a[0]['id'], TERM_OBJ_FILE, $t['ttype'], escape_tags($t['term']), escape_tags($t['url'])); |