I'm trying to submit entityform submissions via this module and I need some help determining the correct format.

Currently I am posting the following json body:

{  
   "type":"my_entity_form_type",
   "values":{  
      "field_first_name":[  
         {  
            "value":"Ryan"
         }
      ]
   }
}

It's posting an entity form submission but without the fields and author information etc. It's also bypassing field validation.

I'm looking for some way to determine the correct format and how to get field validation working.

Any help would be appreciated.

Thanks,
Ryan

Comments

neubreed created an issue. See original summary.

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

That's weird, it should work with generic entities.

Can you do some debugging to see what's getting called by the service?

neubreed’s picture

Thanks Joachim.

I think that's the bit I need help with ..I'm not sure how or where to debug this module. I'd say the way I'm formatting my fields is incorrect. What would be the best way to go about that?

Cheers,
Ryan

neubreed’s picture

I figured out the correct format for posting custom fields:

{
  "type": "my_entity_form_type",
  "field_first_name": {
    "und": [
      {
        "value": "Ryan"
      }
    ]
  },
 "field_last_name": {
    "und": [
      {
        "value": ""
      }
    ]
}
}

But validation isn't working at all. other standard fields are left blank such as UID, date created etc. No error messages come back for required fields. I can post whatever I like even a blank submission which I shouldn't be able to do.

 "entityform_id": "17",
 "uid": "",
  "title": "",
  "created": "",
  "changed": "",
  "data": "",
  "language": "",
  "draft": 0,
joachim’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Ah. See #2213503: call field_attach_validate() prior to saving entities. I thought that had got in -- it hasn't. Can you try it and post feedback over there please?