View Issue Details

IDProjectCategoryView StatusLast Update
1238Composrnewspublic2013-06-13 20:51
ReporterRishi Saravanan Assigned ToChris Graham  
PrioritynormalSeverityfeature 
Status resolvedResolutionfixed 
Summary1238: Capability to add photos in bulk to a news/blog post
DescriptionRight now we can add one at a time while creating the post. One of my site members said it would be great to be able to add photos in bulk, which would save time.

As to how it would work, I would think parameters could be set once for the whole batch, and then we can add captions separately after the batch is uploaded and we see the buttons representing all the images.
TagsNo tags attached.
Attach Tags
Attached Files
news issue photo group.zip (2,471,655 bytes)
Time estimation (hours)3
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

Chris Graham

2013-05-18 19:46

administrator   ~1403

You can attach a zip/tar and tell it to auto-extract. However, I'll leave this open as allowing multi-selections in the uploader would be simpler.

Rishi Saravanan

2013-05-18 20:49

reporter   ~1404

By "leave this open", it means you'll calculate the price to allow multi-selections?

Chris Graham

2013-05-19 13:31

administrator   ~1406

Thanks for the sponsorship :)!

This is now implemented in the 'batch_attachments' branch (a v9 fork). I will keep this tracker issue open until it is merged into the v10 branch.

Rishi - I will now manually deploy for your site.

Chris Graham

2013-05-19 13:37

administrator   ~1407

Note for other users...

While this feature was a bit tricky to implement, the patch is not too bad. You can see the whole thing here:
https://github.com/chrisgraham/Composr/commit/fd969bf2893982269cbc0dc449f6fd6f6b9efb72

It requires the plupload addon.

Chris Graham

2013-05-19 13:49

administrator   ~1408

Rishi - deployed to your site, and (according to my test) working.

Rishi Saravanan

2013-05-19 19:37

reporter   ~1410

Hello,

I ran a test just now. I selected six photos, set them to 'embed directly' and display without thumbnails. It seemed to load them all, as I saw six attachment tag buttons appear. But then when I clicked Preview, and then Add, it wasn't working right. It displays the first photo in full size. Then it displays the 2nd photo full size, and duplicates the 2nd photo four more times. Then it displays the other four photos underneath, but in thumbnail form.

Chris Graham

2013-05-19 20:39

administrator   ~1411

Sorry about that - this should now be fixed.

Rishi Saravanan

2013-05-19 22:31

reporter   ~1412

I tested with the same six images again, same instructions. This time it displays the first image six times, then displays the other five images in thumbnail style

Chris Graham

2013-05-20 14:07

administrator   ~1414

Sorry again, I hadn't quite put the fix up correctly. I have now, and I have re-tested on your end and it seems to have worked.

Rishi Saravanan

2013-05-20 15:15

reporter   ~1415

okay, working now, thank you!

Rishi Saravanan

2013-05-20 19:21

reporter   ~1418

One thing I just noticed, is that after selecting and uploading multiple files at once, we don't get another upload field for adding more files. An example of needing this capability, is the 10mb single upload limit. Someone might need to do multiple uploads of bulk photos because of this.

Chris Graham

2013-05-20 22:04

administrator   ~1419

Fixed

Rishi Saravanan

2013-05-21 01:51

reporter   ~1427

okay, tested and looks good, thank you

Rishi Saravanan

2013-05-22 19:19

reporter   ~1441

Hello Chris,

We just discovered a bug related to which browser is being used. I had only tested on Chrome and it worked.
Another monk here tried to create a news article in firefox v.21. He uploaded bunch of photos at once. They all loaded and the comcode tags appeared. He then clicked Preview button so that he could then see which photo was related to which tag, and rearrange the tags and add captions. However after clicking Preview, he could not select, move, or put the cursor between any tag. I think he couldn't do this before clicking Preview either.

I haven't tested this in any other browser.

Rishi Saravanan

2013-05-22 19:27

reporter   ~1442

I also notice that the blue upload progress bar appears separately for each upload, and there is a brief pause between each one. This could cause a user to think the uploading is done before it actually is and start pressing other buttons prematurely. Could you make it so that only one progress bar appears which encompasses all the images as they're uploading?

Chris Graham

2013-05-22 22:09

administrator   ~1448

Browser's can be a bit awkward about clicking between things in the editor. I have now amended it to have a line break between them, this should resolve the issue.

Regarding a combined upload bar, this is a bit awkward. If I remember correctly, we have made some design changes to the uploader in v10, making multiple bars visible at once. Having just a single bar would be prohibitively difficult, because we'd need to get quite deep in making changes to plupload.

Rishi Saravanan

2013-05-23 01:58

reporter   ~1450

Thank you for the amendment.

Okay, multiple bars solves that issue.

Rishi Saravanan

2013-05-23 04:28

reporter   ~1451

We encountered bugs over the course of a few hours this afternoon which we're having a hard time pinpointing the exact source, and I don't even know if it's due to this new feature of multiple image file selection for uploading, or if it was something pre-existing. It's mysterious

1) If we go to news article creation screen, paste in the text of an article, put the cursor near top and upload one image attachment there, then go down to bottom of article and put the cursor there, click 2nd 'browse' button and select a group of images, all the tags are added, we wait for them all to finish uploading, then we click 'Preview', it shows only the first single image we uploaded plus the very last image in the 2nd group we had uploaded. If we click 'Add' article, that's still what we see.

2) Now a slightly different scenario-- If we go to news article creation screen, paste in the text of an article, put cursor at the bottom and upload all the images at once in one 'browse', then click 'Preview', then cut and move one of the attachment tags and paste it higher up in the article, then click Preview again, it hangs for a while and then tells us Internal Server Error. If we then click 'Add', it hangs some more and finally returns another Internal Server Error, but then we find the article listed in Latest Headlines, but if you click in to it you see this message in the article body-- "[This entry failed to be properly created; please edit/delete as appropriate]". However another time after going through the same creation process and encountering the error, I discovered that the full article did actually appear including the photos. But when I went in to edit it and add some caption text next to attachment tags and then clicked Save, it didn't save anything I had added.
------------

We were doing so many tests of all this with little variations, trying to pinpoint what's going on, so it's hard to describe everything to you, but maybe you have enough to work with. We can try and fetch the server error log if you need to see that.

Chris Graham

2013-05-23 17:43

administrator   ~1454

This feature is certainly turning into quick a complexity, tracking all the different file-sets/Comcode and settings across Javascript/HTML/requests.

I believe I have fixed '1'.

I could not reproduce '2' on your server or my dev server. However I tried after fixing '1', which means it may have been the same as '1'.

Rishi Saravanan

2013-05-23 19:04

reporter   ~1456

yes, complex!

Okay, just now I tested the 1st scenario again with the same image files. I used 13 images in total. Total size is only about 2.5 mb. This time the Preview showed everything correctly, but when I clicked 'Add' it hung for a while and finally returned 'Internal Server Error'. For a while the article entry didn't show up at all in the site, then ten minutes later it appeared but in the body text says "This entry failed to be properly created..."

Next I duplicated the 2nd scenario, and the same thing happened as yesterday.

I did all this in Chrome, and I was masquerading as user 'Saiva Siddhanta Church'. To be sure the masquerading wasn't causing a problem, I tried it without masquerading and same thing happened.

Chris Graham

2013-05-24 18:36

administrator   ~1457

I am currently working on this. There have proven to be great complexities to it. I realise the uploader progress code worked very poorly on remote sites and bulk uploads, so this is improved. Also some other minor issues of the UI. I have also disabled the memory limit when attachments are uploaded, as I suspect thumbnail generation caused a memory-exceed. I am still working on an issue of things connecting up properly.

Chris Graham

2013-05-24 22:37

administrator   ~1458

Ok, I hope it is all sorted now :). A lot of time spent in the guts of the uploader code today.

Rishi Saravanan

2013-05-24 23:02

reporter   ~1459

So sorry this is taking up much more time than you anticipated! I can only imagine how complex the guts must be.

Well, I tested the 1st scenario again just now and got same result as described above. The only difference was that this time there were upload progress bars for each image.

Chris Graham

2013-05-24 23:03

administrator   ~1460

Please could you attach a zip for each file set to this issue? Perhaps it depends on the particular files.

Rishi Saravanan

2013-05-25 01:40

reporter   ~1463

Attached are the image files I've been working with

Chris Graham

2013-05-25 19:36

administrator   ~1464

I was able to reproduce an internal server error, which I think could also result in jumbled attachments. I was able to fix this, plus also optimise the code a little.

You may need to empty your browser cache, as we've changed the Javascript files quite a lot.

I recorded a video of it working:
http://screencast.com/t/Dbazny1B3JY
I pasted in some Google results for the content, just because I wanted something complex, more likely to go wrong if there was a bug.

(Please ignore my messing about rating songs in iTunes, I forgot I was recording for one second! ;-))

Rishi Saravanan

2013-05-25 21:26

reporter   ~1465

yes! Success, both scenarios are working! :)
glad you were able to reproduce the error and pinpoint the issue

Issue History

Date Modified Username Field Change