]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #135 not posting the batch to the river on first upload to an album
authorCash Costello <cash.costello@gmail.com>
Sun, 5 Jun 2011 12:25:10 +0000 (12:25 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 5 Jun 2011 12:25:10 +0000 (12:25 +0000)
actions/ajax_upload_complete.php
actions/upload.php

index b66b563e3e9bd3fcf69cb1eb7f0ff9d7caac9a2c..2abca50dcc6f053eb390d52260dc7956121ddd6c 100644 (file)
@@ -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());
                }
        }
index f2b626f01cb1b06298910559e78873ffaa4aca72..c0496da966b513c3a4ac36f66add06d858d54da4 100644 (file)
@@ -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());
                }
        }