set the correct album name when moving photos
This commit is contained in:
		| @@ -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']), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user