set the correct album name when moving photos

This commit is contained in:
Mario Vavti 2018-07-18 13:18:37 +02:00
parent c2e819771f
commit eb322e8312

View File

@ -2325,6 +2325,7 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) {
return false; return false;
$newdirname = $n[0]['filename']; $newdirname = $n[0]['filename'];
$newalbumname = $n[0]['display_path'];
$newstorepath = dbunescbin($n[0]['content']) . '/' . $resource_id; $newstorepath = dbunescbin($n[0]['content']) . '/' . $resource_id;
} }
else { else {
@ -2332,6 +2333,7 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) {
// root directory // root directory
$newdirname = EMPTY_STR; $newdirname = EMPTY_STR;
$newalbumname = EMPTY_STR;
$newstorepath = 'store/' . $c['channel_address'] . '/' . $resource_id; $newstorepath = 'store/' . $c['channel_address'] . '/' . $resource_id;
} }
@ -2419,7 +2421,7 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) {
if($r[0]['is_photo']) { if($r[0]['is_photo']) {
$t = q("update photo set album = '%s', filename = '%s', os_path = '%s', display_path = '%s' $t = q("update photo set album = '%s', filename = '%s', os_path = '%s', display_path = '%s'
where resource_id = '%s' and uid = %d", where resource_id = '%s' and uid = %d",
dbesc($newdirname), dbesc($newalbumname),
dbesc($filename), dbesc($filename),
dbesc($x['os_path']), dbesc($x['os_path']),
dbesc($x['path']), dbesc($x['path']),