aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Attach_edit.php2
-rw-r--r--include/import.php7
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']));