From aab76ab18aa6c191dd16c3672afdacfa61ae69bb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 5 Jun 2011 12:25:10 +0000 Subject: Fixes #135 not posting the batch to the river on first upload to an album --- actions/ajax_upload_complete.php | 8 +++++++- actions/upload.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/actions/ajax_upload_complete.php b/actions/ajax_upload_complete.php index b66b563e3..2abca50dc 100644 --- a/actions/ajax_upload_complete.php +++ b/actions/ajax_upload_complete.php @@ -11,6 +11,12 @@ if (!$album) { exit; } +if ($album->new_album == TP_NEW_ALBUM) { + $new_album = true; +} else { + $new_album = false; +} + if ($album->new_album == TP_NEW_ALBUM) { $album->new_album = TP_OLD_ALBUM; @@ -38,7 +44,7 @@ if ($images) { foreach ($images as $image) { add_entity_relationship($image->guid, "belongs_to_batch", $batch->getGUID()); } - if (get_plugin_setting('img_river_view', 'tidypics') == "batch") { + if (get_plugin_setting('img_river_view', 'tidypics') == "batch" && $new_album == false) { add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID()); } } diff --git a/actions/upload.php b/actions/upload.php index f2b626f01..c0496da96 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -23,6 +23,12 @@ if (!$image_lib) { $img_river_view = get_plugin_setting('img_river_view', 'tidypics'); +if ($album->new_album == TP_NEW_ALBUM) { + $new_album = true; +} else { + $new_album = false; +} + // post limit exceeded if (count($_FILES) == 0) { @@ -177,7 +183,7 @@ if (count($uploaded_images)) { foreach ($uploaded_images as $uploaded_guid) { add_entity_relationship($uploaded_guid, "belongs_to_batch", $batch->getGUID()); } - if ($img_river_view == "batch") { + if ($img_river_view == "batch" && $new_album == false) { add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID()); } } -- cgit v1.2.3