aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorsasiflo <dev@sasiflo.de>2016-05-17 12:27:15 +0200
committersasiflo <dev@sasiflo.de>2016-05-17 12:27:15 +0200
commitbfbe6c166081608deaa1e388f6287a1bf933c0c6 (patch)
tree742a81e2ae51392c4f7282a539fe32ad5f364a58 /include
parent51edd472c2e007490bdad3198ba1b2a3d7a09c45 (diff)
downloadvolse-hubzilla-bfbe6c166081608deaa1e388f6287a1bf933c0c6.tar.gz
volse-hubzilla-bfbe6c166081608deaa1e388f6287a1bf933c0c6.tar.bz2
volse-hubzilla-bfbe6c166081608deaa1e388f6287a1bf933c0c6.zip
Synchronization: Directory creation on sync import corrected.
Diffstat (limited to 'include')
-rw-r--r--include/import.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/include/import.php b/include/import.php
index 00058047e..a62ec4ed5 100644
--- a/include/import.php
+++ b/include/import.php
@@ -973,8 +973,11 @@ function sync_files($channel,$files) {
$attach_exists = false;
$x = attach_by_hash($att['hash']);
+ logger('sync_files duplicate check: attach_exists=' . $attach_exists, LOGGER_DEBUG);
+ logger('sync_files duplicate check: att=' . print_r($att,true), LOGGER_DEBUG);
+ logger('sync_files duplicate check: attach_by_hash() returned ' . print_r($x,true), LOGGER_DEBUG);
- if($x) {
+ if($x['success']) {
$attach_exists = true;
$attach_id = $x[0]['id'];
}
@@ -1043,15 +1046,17 @@ function sync_files($channel,$files) {
if($attach_exists) {
- $str = '';
- foreach($att as $k => $v) {
- if($str)
- $str .= ",";
- $str .= " `" . $k . "` = '" . $v . "' ";
- }
- $r = dbq("update `attach` set " . $str . " where id = " . intval($attach_id) );
+ logger('sync_files attach exists: ' . print_r($att,true), LOGGER_DEBUG);
+ $str = '';
+ foreach($att as $k => $v) {
+ if($str)
+ $str .= ",";
+ $str .= " `" . $k . "` = '" . $v . "' ";
+ }
+ $r = dbq("update `attach` set " . $str . " where id = " . intval($attach_id) );
}
else {
+ logger('sync_files attach does not exists: ' . print_r($att,true), LOGGER_DEBUG);
$r = dbq("INSERT INTO attach (`"
. implode("`, `", array_keys($att))
. "`) VALUES ('"
@@ -1064,6 +1069,7 @@ function sync_files($channel,$files) {
if($att['filetype'] === 'multipart/mixed' && $att['is_dir']) {
os_mkdir($newfname, STORAGE_DEFAULT_PERMISSIONS,true);
+ $attachment_stored = true;
continue;
}
else {