PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Images Database Records Deleted on Entry Edit

  1. We're using Gravity Forms to collect member-signup information for a directory site, including user-uploaded photos, but have run in to a problem with images disappearing when we edit entries.

    Everything works as expected on the front-end. The images are uploaded properly and associated with the correct listing. We can view the entry via Form > Entries > Entry Detail and see the image. However, if we edit the entry, the image disappears. It doesn't matter what is changed, or if anything is changed at all - if the edit button is clicked, the image disappears. It happens consistently on every edit of every entry in every form. The image is the only data that is lost - everything else is maintained, and the image is still physically present on the server.

    I used the SQL Monitor plugin to trace the database queries being run when an entry is updated, and found two delete queries that I believe are responsible. I've pastebinned the results to preserve the formatting, they can be found here: http://pastebin.com/zFjLecP4. For reference, the image's field_number is 52.

    I can't figure out why editing an entry should cause an unchanged record to be deleted. The expected behavior would be an update if the image had changed, but I would assume that if no change was made to the image (and none has been, I've run through this several dozen times) then the record should be left untouched. In particular, I can't figure out why only one record would be affected, and why it should be the image. I've checked the database, and the record is definitely deleted on edit.

    I've done the usual troubleshooting steps, disabled other plugins, created a duplicate of the form to test on, created an entirely new form to test on, tried both types of upload fields, and it consistently returns to the same result: No matter what form or field is used, editing the entry deletes the image's record. I've run out of ideas, so I'm hopeful someone with more experience with the plugin can shed some light on the situation and offer a solution.

    ---
    Justin Ryan @ DuckDuckBlue,
    for Kelly Williams

    Posted 14 years ago on Friday March 18, 2011 | Permalink
  2. What version of Gravity Forms are you using? You can find this information under Forms > Settings.

    Posted 14 years ago on Friday March 18, 2011 | Permalink
  3. PHP Version 5.2.17
    MySQL Version 5.0.91
    WordPress Version 3.0.4
    Gravity Forms Version 1.5.RC3.14

    Wordpress version is 3.0.4.

    Thanks for your help.

    JR

    Posted 14 years ago on Saturday March 19, 2011 | Permalink
  4. The first thing you need to do is upgrade the version of Gravity Forms you are running. That is an older development release. There is a newer development release on the Downloads page and the final release is expected anytime now.

    Posted 14 years ago on Monday March 21, 2011 | Permalink
  5. Upgraded to version 1.5RC4.2, Wordpress 3.1, and the issue is still present. Any other suggestions?

    Posted 14 years ago on Wednesday March 23, 2011 | Permalink
  6. Final release has also been installed last night... Is there any help for us?
    Thanks so much!!

    Posted 14 years ago on Friday March 25, 2011 | Permalink
  7. Sorry Kelly, it must have slipped through the cracks. I'll look into it and see whats going on and if it is a bug we'll get it fixed in 1.5.1 and if we can't replicate it i'll be in touch.

    Posted 14 years ago on Friday March 25, 2011 | Permalink
  8. rogerlos
    Member

    Just to add to Kelly's lament, the same thing happened to me.

    If I had to guess as to the cause, it's that the browse control is shown when editing, and of course no new image is browsed to, so on save the entry editor thinks there is no image there. Ideally, there would just be a plain-jane input field shown on edit with the path to the image in it?

    (I peeked at the database entry via phpmyadmin and indeed the entry no longer records the image path; however, the image is still present in the gravityforms upload folder.

    Posted 14 years ago on Wednesday April 6, 2011 | Permalink
  9. @rogerlos We have already corrected this issue and it will be included in the 1.5.1 release. If you want the interim build that corrects this issue I can send it to you via email. Just use our Contact Us form and request it and we will send it over.

    Posted 14 years ago on Wednesday April 6, 2011 | Permalink
  10. rogerlos
    Member

    Thanks for the offer, I can wait until the release, there is no pressing need for it just yet in my application. I was fooling around and noted the error, and then searched here to see if anyone else had reported it.

    Posted 14 years ago on Thursday April 7, 2011 | Permalink