When you click on the "Upload" button next to an image it treats is as if clicking to the "Submit" button for the node. This patch fixes this issue. Based largely on work done by jpesto in this thread. http://drupal.org/node/269073

The patch also cleans up a few issues with trailing whitespace on some lines.

Comments

sirkitree’s picture

Status: Needs review » Needs work

this totally fails against HEAD.

I noticed the long path names within the first two lines which tells me that you ran the patch command outside of the imagefiled directory and this makes it hard for others to apply the patch.

After changing this houwever in my local file the patch still fails:

~/Sites/d6/sites/all/modules/contrib/imagefield $ patch -p0 < EOJTHEBRAVE-20080624-imagefield_submit_fix.patch 
patching file imagefield.module
Hunk #1 FAILED at 84.
Hunk #2 FAILED at 298.
Hunk #3 FAILED at 463.
Hunk #4 FAILED at 483.
Hunk #5 FAILED at 532.
5 out of 5 hunks FAILED -- saving rejects to file imagefield.module.rej
eojthebrave’s picture

Yeah, looks like HEAD has changed quite a bit since I created that patch. I should be able to re-roll it against current imagefield HEAD tonight or tomorrow sometime.

eojthebrave’s picture

Status: Needs work » Fixed

Okay, I downloaded and installed a copy of imagefield HEAD, and the problem with clicking the upload button causing the node to be saved and not returning the user to the node edit form has been fixed. It appears that imagefield is now delegating to filefield.module when the upload button is clicked, and filefield.module handles this in a more appropriate way.

Marking this as fixed since it seems to be fixed. But wanted to point out this issue with filefield #286834: Only uploads/removes file if required fields are filled out, then wipes all fields which makes uploading images still somewhat problematic.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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