Progress bar - patch for mediafields

esadot - March 29, 2007 - 18:27
Project:Media Field
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

Would be great if the mediafield module would provide a displayed progress bar. Even better if such capability would be part of the core, or at least as a dedicated module.
Browsing through drupal.org yield several discussions on the subject.

To be more pragmatic: could the progress bar solution incorporated in the video module (http://drupal.org/node/69800) be imported? or be affiliated? or detached to a dedicated feature / module?

#1

laurentchardin - April 4, 2007 - 09:23

For informations, the Imagefield project just implemented an Ajax upload feature with a progress bar... i guess it might be possible to join forces on this (the code is not too complicated)
(since filefield, imagefield, mediafield already share some common code...)

#2

ARDAS - April 4, 2007 - 09:52

Thank you for the information.
We will work on this feature asap.

#3

ARDAS - April 4, 2007 - 13:20

I didn't find AJAX upload in a new imagefield.module.
Are you sure?

#4

laurentchardin - April 4, 2007 - 15:38

Yes Ajax upload support has been added to the DRUPAL-4-7--2 and DRUPAL-5--2 branches (not sure it has been comited as stable yet).
You might have to grab the cvs version to get the updated code.

Newbie question : think it could be usefull to merge/pack Imagefield and Mediafield (ala e-commerce), to work on common include files (file operation, id3, ajax support while keeping CCK definition apart) ?

#5

ARDAS - April 4, 2007 - 15:50

Ok, I'll try it.

Packing all CCK file fileds together is a good idea and it is already discussed with imagefield author (Dopry). I'm now waiting for an answer from him about the better approach to do that. At the moment he thinks that he will put our common file into fileupload.module and make all other such media modules depend on it.

#6

esadot - April 6, 2007 - 20:46

I might be missing something.
I checked out drupal 5.2, cck and imagefield 5.2, created new type which contain cck image, but when i upload an image the progress bar doesn't present itself.

#7

ARDAS - April 9, 2007 - 11:19

I also didn't find it.

#8

ARDAS - April 22, 2007 - 08:10
Status:active» postponed

#9

VeryMisunderstood - December 26, 2007 - 23:14
Status:postponed» active

The progress bar is included in the 2.x-dev version of the imagefield.module.

I've tried playing with the code to get it to work correctly, in the mediafield.module but alas, I could not.

I think this would ease quite a bit of the frustration with users who get impatient waiting for the browser progress bar to complete.

the image module calls the progress bar around line #573

function _imagefield_widget_form($node, $field, &$items) {
  drupal_add_js('misc/progress.js');
  drupal_add_js('misc/upload.js');

There must be more to it then what is above, because I added those lines to the audiofield.module and the progress bar did not appear.

I'm going to mark this issue as active, so that I can work on it some more and hopefully others will jump in.

ARDAS, if changing the status is the wrong this to do for this, I apologize in advance

#10

panis - January 14, 2008 - 13:26
Title:Progress bar» Progress bar - patch for mediafields

Patch to add progress bar to videofield and audiofield modules.

Note the progress bar does not really show actual progress but only displays a dynamic gif.

If you want to see actual progress i.e. %uploaded - I have code that can help.

PHP had limitations until PHP5.2 where it is unable to provide upload reliable information (%uploaded etc) for PHP applications.
PHP 5.2 and above supports the functionality however you must do 2 things:

a) install an extension such as APC (doesnot work in CGI or fastCGI) or uploadprogress (buggy but works with CGI and fastCGI) - this is not yet supported by my module.

b) add support to drupal's upload.js and some custom code to actually fetch the progress. see http://www.hyrme.com/node/18 if you are feeling adventurous.

AttachmentSize
mediafield-progress.patch16.68 KB

#11

esadot - January 16, 2008 - 16:12

Thanks panis.

Can you publish a module that offers actual progress bar to the benefit of Drupal community (with the limitation of php5.2)

Regards,

#12

panis - January 16, 2008 - 17:28

I already have one on my site - I do not want to upload it onto drupal.org without a more testing..
Also so that I do not duplicate code - my approach will need a patch to misc/upload.js to make use of existing hooks in drupal - do you think that is acceptable?

#13

VeryMisunderstood - January 19, 2008 - 21:47

The patch in #10 works wonderfully. I think this is a great addition. My opinion is this is RTBC

#14

esadot - January 20, 2008 - 19:52

panis - my suggestion would be to craft it as a (alpha or beta) module, and let the drupal community plays with it. Introducing as a module will (imho) draw the exposure one would hope for.

Many drupal modules would benefit from a real progress bar (from ec via media/video to webfm), and if patches to other files (i.e. misc/upload.js) are required at this stage - let it be.

My 2 cents

#15

VeryMisunderstood - January 22, 2008 - 03:03
Category:feature request» task
Status:active» patch (code needs review)

#16

ARDAS - January 24, 2008 - 06:39

I will review the patch soon. Thanks a lot for your patience and work.

#17

DanielTheViking - February 19, 2008 - 11:18

Subscribing.

#18

werushka - April 7, 2008 - 00:31

great module...is there a way to upload many images without page reload, because when I press on upload it uploads and refreshes the page...gives error if the user has not yet entered subject etc.

#19

a_c_m - April 13, 2008 - 11:04
Status:patch (code needs review)» patch (reviewed & tested by the community)

I echo VeryMisunderstood's comment, the #10 patch worked great, RTBC.

#20

capellic - April 15, 2008 - 01:33

Thanks - this really came in handy!

#21

Eugef - April 20, 2008 - 11:57

Subscribe -
I am waiting for a new version of module with ajax uploading!

#22

Shinzon - June 13, 2008 - 09:24

Is there any way to implement that patch to AUDIO module? That patch work for AUDIOFIELD, but i need that in audio module.

#23

a_c_m - June 14, 2008 - 11:07

@Shinzon : I doubt it, different modules means different code, so a code patch is very unlikely to work. You might open a issue in the AUDIO module's queue asking for the feature, and/or start a bounty to get it done.

#24

a_c_m - June 26, 2008 - 07:43
Status:patch (reviewed & tested by the community)» fixed

This patch is now in HEAD (http://drupal.org/cvs?commit=123607) and will be included in the next release.

#25

Anonymous (not verified) - July 10, 2008 - 07:52
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.