#257 ✓resolved
Kieran P

Creating image without image data causes 500 error instead of validation errors

Reported by Kieran P | March 11th, 2010 @ 12:00 PM

When you submit an still image for creation, without the image file field filled in, the expected response is a validation message "please provide an image to upload" or similar.

The actual response is an error 500 page caused by a merge in the code on a nil value (nil.merge)

The value in question, params[:image_file], is being sent when posted (firebug confirms this data is sent) but by the time it reaches Rails controller request, the blank data is being stripped from the params, thus params[:image_file] is nil, and the nil.merge error occurs.

Debug steps taken:

  • Rolling back to a 5 month old copy of Kete (and thus rails to 2.3.4) shows that the error occurred then as well.
  • Rolling back to an older copy of rack did not have any effect
  • A small sample application with a similar multi-model setup has no issues with sending blank data, and does not suffer from the nil.merge issue.
  • Commented out the params filter in application controller but no change
  • Tested on both a deployed and local copy, one with new relic installed and the other without. No change between the two.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Kete was developed by Horowhenua Library Trust and Katipo Communications Ltd. to build a digital library of Horowhenua material.

People watching this ticket