If more than one file is upload they both disappear and the text already in the body of the commentary also disappears.

introfini

Comments

AmrMostafa’s picture

Version: 6.x-1.0-alpha3 » 6.x-1.x-dev

I don't have the exact problem, but something very similar..

  • I got a project_issue node, where I've the comment form automatically displayed at the bottom
  • I upload a file, after the upload is complete the file is displayed in the list, I didn't click 'Save' yet.
  • I choose another file and click 'Attach', after the upload is complete, the file is displayed in the list but the previous file is lost. i.e. Only 1 file displayed in the list now, I didn't yet click 'Save'.
  • I click Browse and choose the first file from my computer, click Attach, after the upload is complete, I see the file in the list, and previous file is kept. i.e. I've 2 files now.
  • I click Browse and choose a different (third) file from my computer, click Attach, after the upload is complete I see the file in the list, but one of the previous files (specifically the one from the previous step) is no longer there. i.e. I've 2 files in the list now.

This is confirmed in 6.x-1.x i.e. the DRUPAL-6--1 branch.

AmrMostafa’s picture

I should note that the first attach is handled by AHAH, while the second attach it appears that no AHAH is invoked and/or the form is submitted typically (i.e. no AHAH magic)

AmrMostafa’s picture

The bug affects d.o from my testing results.

junito caramel’s picture

Version: 6.x-1.x-dev » 6.x-1.0-alpha3

Same thing happend to me:

- When I attach 1 file and save, the file link doesn't appear
- When I attach 2 files, the first one disappear after I attach the second one. Adding a third one is OK in the form but only ONE file (the second) appears after saving.

jrglasgow’s picture

I am getting a similar problem, but with my site anytime a file is uploaded using the AHAH method the file isn't saved.

AmrMostafa’s picture

StatusFileSize
new4.82 KB

Here is a patch. What I did was copy upload_js() and adjust it for comment_upload. I believe this module may have started off with a similar path, and any changes made which resulted in the existing code were made for a good a reason, but I couldn't know why.

AmrMostafa’s picture

Version: 6.x-1.0-alpha3 » 6.x-1.x-dev
jrglasgow’s picture

@alienbrain,
the patch applied correctly, but when I tried to test it I got an error with PHP not being able to include the comment_upload.module file - permission denied

jrglasgow’s picture

StatusFileSize
new4.89 KB

@alienbrain,
I re-applied your patch in #6 by hand and after I cleared the cache it works great. Here is a patch from my machine that should work.

jrglasgow’s picture

Status: Active » Needs review
netaustin’s picture

Status: Needs review » Fixed

Reviewed, tested and committed (200394). This fixes the multiple-upload problem while preserving the "can't change description" fix, which results in a module that seems to be completely usable on its own.

Thank you both very much for working on this.

jo_54’s picture

hello

thank for your very reactiv work !
just one last thing :
when i make a preview, all data ( comment and uploaded files ) disappear ! ??

Pending to correct this problem,
you can remove "preview" boutton in doing this :
// $Id: comment.module,v 1.617.2.4 2009/01/06 17:34:54 goba Exp $
// line 1394 --> //$form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 20);

jo_54

Status: Fixed » Closed (fixed)

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

heine’s picture

OT but perhaps interesting history; upload_js was based comment_upload_js when it was rewritten during SA-2008-047.