Closed (fixed)
Project:
Image Assist
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Feb 2007 at 23:39 UTC
Updated:
7 Mar 2007 at 02:30 UTC
Jump to comment: Most recent file
When uploading an image in img_assist's popup window the form reappears after submission with the image displayed as a thumbnail but with the title and body empty. Those values have to be reentered and the form has to be resubmitted. After that it works like it's supposed to.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | img_assist-upload-070217.patch.txt | 1.12 KB | zoo33 |
| #5 | img_assist_double_post_0.patch | 1.19 KB | moonray |
| #1 | img_assist_double_post.patch | 1.2 KB | moonray |
Comments
Comment #1
moonray commentedPatch attached. This one was actually really simple (even though it took me a while to find it). :-)
Comment #2
mlsamuelson commentedI tested the patch. It solves the issue.
Cool! Thanks Moonray.
mlsamuelson
Comment #3
darren ohThat sounds like a review.
Comment #4
zoo33 commentedGood thing we found the broken part. However this patch will defeat the purpose of the
switchstatement, whatever that purpose is, as the result will be the same regardless of the value of$op. Can it be safely removed? Why is it there?Another thing:
img_assist_upload()is currently using$_POST['op']which should be replaced by$form_values['op']according to this (but how do we make the form variables available to this function?).Comment #5
moonray commentedYou are right, of course. I did think about that when I originally spotted the problem, but then I somehow forgot to take out the switch. From what I can tell, all the relevant code is in
img_assist_node_add().Find new patch attached.
Comment #6
zoo33 commentedYeah, I can't understand why that switch was there in the first place. If someone has an idea, please tell!
Anyway, with that removed, $_POST['edit'] is not used anymore, and I also removed $_POST['op'] since that variable isn't used either (not even before this patch). Attaching a new path, should be OK, but please take a look...
Comment #7
manal commentedsubscribing
Comment #8
moonray commentedThanks for the code cleaning. Goes to show I should never do anything in a rush. :-)
Last patch looks good to be committed.
Comment #9
moonray commentedComment #10
zoo33 commentedCommitted.
Sorry, I just realized I forgot to give you credit in the cvs message, moonray. I'll double-praise you once we're done with the HTML mode bug. :)
Let's just hope that switch statement didn't do anything important... Better keep this in mind if some weird bugs should turn up...
Comment #11
pj@plainjaingraphics.com commentedAnd how do I apply a patch?
Comment #12
zoo33 commentedPlease don't change the issue title unless you have good reason for it, it makes it hard for people to keep track of which issue is which. (Perhaps you didn't realize you changed the title of the whole issue.)
As a rule of thumb, the last patch in an issue is usually the one you should use since it's probably the one that's evolved most. In this case the patch has been committed, which means it's been incorporated into Drupal's code repository (CVS server). When that happens, it will automatically become a part of the latest dev version of the module within a few hours. So all you have to do is download the 5.x-dev version on img_assist's project page.
For information on patching files, there is a page in the handbook about it.
Comment #13
pj@plainjaingraphics.com commentedThanks for telling me about not changing the thread title - I really didn't realize the ramifications of doing it. I'll make sure not to do it in the future.
I'll go download the latest version of this module and hope it works. Thanks for responding to my question.
Comment #14
(not verified) commented