Getting a '400' error on production

Service: Hoop.la

Getting a '400' error on production

Service: Hoop.la

There is a script that is not working on the production site located here:

https://garage.bfgoodrichtires...ory-submissions/post

To replicate this issue:

  • From the main nav on the production site select "Stories"
  • In the top-right of the screen select "Submit a story"
  • Complete Step 1 & Step 2 
  • On step 3, you are asked to upload a photo. Browse for a photo and upload.
  • Error (read below) will log to console. This error only occurs on the production site. The staging site works as expected

Failed to load resource: the server responded with a status of 400 (Bad Request)

https://garage.bfgoodrichtires...d=484178052475846997

Attachments

Photos (2)
Original Post
Votes (0)

Activity Stream

Hi Casey,

If you inspect the JSON response from that request, you should see something like this:

 {"files": [
{
"id" : "uploadFormFor_REGULAR_FILES_DATABASE_RECORD_FIELD__484178052475846997_0"
, "file_type" : ""

, "error" : "Photo files are not allowed."
}
]}

The issue is that photos aren't allowed in that field. Has somebody changed the configuration of your database recently? Look here:

https://garage.bfgoodrichtires...e=482066839222280075

The multiplePhotoUpload field you have only supports regular files and documents. As it is configured right now, it will not allow audio, video, or photo files to be uploaded, which is why the error is happening. To fix, you should add a new field of type Photo instead. You'll probably want to remove the old/incorrect field and give the new Photo field the same name.

The reason your staging site works is because it is properly configured to allow photos:

https://staging.garage.bfgoodr...e=461659882626644427

See "Multiple Photos" listed as the type vs. "Multiple Files" on your production site.

Hope that helps!

Brian

Add Reply

×
×
×
×