Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
But the Plupload node creation process is almost too darn smooth.
Some way of providing user feedback like "15 Nodes Created" or "15 Images Uploaded" would be handy.
I haven't looked at all into what it would take to do this. I'd like to tackle this, but if someone has already put brain power into this, then great.
Comment | File | Size | Author |
---|---|---|---|
#34 | plupload-954742-33-success-behaviors.patch | 3.66 KB | justintime |
#32 | plupload-954742-32-success-behaviors.patch | 18.61 KB | justintime |
#22 | plupload-954742-22-success-behaviors.patch | 3.69 KB | vordude |
#20 | plupload-954742-20-success-behaviors.patch | 3.8 KB | vordude |
#18 | plupload-954742-18-success-text.patch | 3.51 KB | vordude |
Comments
Comment #1
gregglesThe imagex module shows a view of recently created images underneath the upload widget. If we refresh that after every upload, or just periodically I feel like that's a decent solution. We can make the links in this view open in a new tab for easy editing.
Comment #2
justintime CreditAttribution: justintime commentedI've thought this before as well -- we need some sort of "It Worked!!!(TM)", but haven't started on anything. Go ahead and take a crack at it!
Comment #3
vordude CreditAttribution: vordude commentedComment #4
scroogie CreditAttribution: scroogie commentedThe imagex module shows a view of recently created images underneath the upload widget. If we refresh that after every upload, or just periodically I feel like that's a decent solution.
I hope you don't mean providing such a view in plupload? I think it's overkill. It already provides a list of files with a green check mark if the file was uploaded successfully. The view would basically be a duplication of that. I think a javascript hook hook_plupload_finished() or something would be enough. Everything else could be contrib. Only my personal view though.
Comment #5
justintime CreditAttribution: justintime commentedWhether or not this is implemented, here's an example of how to do it.
Comment #6
pribeh CreditAttribution: pribeh commentedsubscribing.
Comment #7
greggles@scroogie, I think the view is useful. Right after you have uploaded content what are you most likely to do? Edit the content. Providing a view that both indicates success, gives reassurance that all the images you uploaded are there, and lets you easily get to them for editing seems like a great feature.
@pribeh, can you say whether your are in favor or not?
Comment #8
justintime CreditAttribution: justintime commentedWhatever we go with, it should be configurable. It all depends on whether you're using plupload directly, or another module is wrapping it. My case is the latter, and I have plupload on a tab. I use hook_help to tell the user where to go after the upload is complete, and it's another tab labeled "Manage Images". On that tab, the only thing displayed are the last uploaded images, so at least in my case, the view would be redundant information taking up DB query time.
Comment #9
pribeh CreditAttribution: pribeh commented@greggles, I totally support this initiative. I came to the issue que looking for such a solution. I'm already testing this module with users and their first response always is "what now" after they've uploaded the images.
This is a great module and I love the integration but we either need this to work in a node form with multiple imagefields (such as described here http://drupal.org/node/929510) or we need to be able to call a view (or sent to a view) with each imagefields' corresponding node listed so that users can immediately see an impact of their actions and then easily edit these nodes.
Comment #10
pribeh CreditAttribution: pribeh commented@justintime #8 I agree. An option to choose a View is optimal. There's also the possibility that we might be able to get this going by using the code you linked to in #5 in the header of a View's block to refresh a view block. I was trying to use Views Auto-refresh (from views_hacks) with a block of images placed below the plupload form that would refresh every thirty seconds or so. So as a user was uploading images the block would likely refresh in time for them to notice. Unfortunately the ajax here was broken for some reason while the plupload form was on the same page as the refreshing view. My javascript and php skills are limited and I don't have any good php programmers at my disposal for this problem right now.
Comment #11
vordude CreditAttribution: vordude commentedThis is my first go at adding a file through a patch, so this may fail horribly. :)
This outputs Some simple simple "yay, success!" text through a theme function, and does a pretty Jquery slideUp to "replace" the Plupload header which is not useful to the user after the upload is complete anyway.
Since many users have a different perspective on the "right" thing to see. Let many users choose what they want to see by simply overriding a theme function. This also doesn't create dependencies on other modules, (views, etc.) unless someone wants to put a views_embed_view() in the theme function.
Comment #12
pribeh CreditAttribution: pribeh commentedThanks vordude. I'll test it out right now. I'll see if I can get the theme override to pull a view of my choice.
Comment #13
pribeh CreditAttribution: pribeh commentedHi vordude, I just made the following changes to my theme override to print a View of the photos that we're just uploaded:
But I can't figure out how to alter your javascript to get what I'm trying to do. Essentially, I'm just trying to load the View upon successful completion of the photos uploaded instead of the success statement. My javascript skills suck though so any help would be much appreciated.
Comment #14
vordude CreditAttribution: vordude commentedYour theme function still wants to return the "empty" div, since the javascript fills it in later.
You want your custom javascript to run something like an $.ajax call to fetch the view. and then drop that inside of the div.
(clear as mud?)
Comment #15
pribeh CreditAttribution: pribeh commentedWicked. I'll try to get some help with the javascript. Thanks vordude!
Comment #16
gregglesIn general this looks fine to me. The comment style isn't perfect, but is close.
I think the js isn't quite right - shouldn't we use behaviors here instead of document.ready?
Comment #17
justintime CreditAttribution: justintime commented@scroogie created some js for node_gallery that allows us to redirect the user to a new URL after the queue completes, and it uses behaviors.
Comment #18
vordude CreditAttribution: vordude commentedHere's a re-roll with some improvements.
1. The inline JS to "set up" the uploader is now in behaviors. (Using Drupal.settings to handle the inline PHP vars)
2.The JS for the the success text is in the same behavior.
3. Various other cleanup. (1&2 keep this from doing the stupid footer stuff from before)
4. I hear there are ponies.
5. Proper (?maybe, more proper?) usage of js translation strings.
I tried rolling this off of git. If it doesn't work for you, throw a hammer at me or something.
Comment #19
vordude CreditAttribution: vordude commentedHmm.. I fear this may break IE8/flash ?
Comment #20
vordude CreditAttribution: vordude commentedDoh!
Is going to break every time...
Here is a re-roll fixing that, and splitting the Plupload creation and the Plupload Success Text into separate Drupal.behaviors (Since then they can be overridden on an individual basis).
Comment #21
vordude CreditAttribution: vordude commentedcrap. I left debug code in there. Stand by...
Comment #22
vordude CreditAttribution: vordude commentedThis one for review please.
...finally.
/facepalm
Comment #23
pribeh CreditAttribution: pribeh commentedThanks vordude. I will try this out and report back.
Comment #24
parasox CreditAttribution: parasox commentedDoes this patch work on the latest dev? I tried it first without checking what version I was running, and it failed.. So I tried to reverse the patch, which also didn't work it seems, because when I upgraded to latest dev and tried to re-apply the patch, it told me the css and js files existed etc.. Then failed again. I tried uploading an image gallery and it worked, but I didn't see any new features as far as upload completion indicators..
I'll try again today with a fresh install of the dev, it was really late when I tried I was half in the bag. Just trying to help get this tested for you Vordude, thanks for the good work!
Comment #25
vordude CreditAttribution: vordude commentedHmm, Yes I was able to apply this patch from the module directory with a patch -p0 < /path/to/patch/plupload-954742-22-success-behaviors.patch
Still having issues?
Comment #26
parasox CreditAttribution: parasox commentedThanks I wasn't using -p0
Tested and works fine for me here, I see the top grey bar change to a success message on upload completion. Thanks!
Comment #27
rjbrown99 CreditAttribution: rjbrown99 commented#22 is working for me. Excellent!
Comment #28
brunorios1 CreditAttribution: brunorios1 commentedsubscribing...
Comment #29
keesee CreditAttribution: keesee commented#22 worked great. I have a question. I would like to make 2 changes.
-- Redirect 3 seconds after message to the manage images page.
-- Add a link to the message "Success! 1 image uploaded. [Manage your new photos here] <- link to manage page for that gallery
----- in case they don't get forwarded.
--
J.
Comment #30
vordude CreditAttribution: vordude commentedNot sure what you mean by "manage page".
This is only creating nodes. There is no pre-baked manage screen for a gallery, since by itself this module doesn't create galleries.
Comment #31
keesee CreditAttribution: keesee commentedMy apologizes. Wrong queue. Using this in conjunction with node gallery.
Thanks for the reply
--
J.
Comment #32
justintime CreditAttribution: justintime commentedAttaching a re-roll against current 6.x-1.x branch. I'd appreciate it if someone could test it and mark this RTBC.
Comment #33
gregglesI started reviewing and it seems good.
It looks like there's some cruft in this patch - specifically the entire plupload.module.orig Can you re-roll without that? It will make reviewing much easier.
Comment #34
justintime CreditAttribution: justintime commentedWhoops, sorry about that.
Comment #35
justintime CreditAttribution: justintime commentedMerged this into 6.x-1.x. Thanks again Vordude.