Closed (cannot reproduce)
Project:
Services
Version:
7.x-3.7
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2014 at 13:42 UTC
Updated:
1 Oct 2014 at 22:24 UTC
Jump to comment: Most recent
Comments
Comment #1
ygerasimov commentedAs services do form submit of the form you need to provide similar values as form does. So please try "tag name (5)" style. If that doesn't work please debug the $form_state['values'] of the form and see how that field is submitted.
Comment #2
Strutsagget commentedIn devel tab it looks like this.
field_users (Array, 1 element)
und (Array, 2 elements)
0 (Array, 1 element)
target_id (String, 1 characters ) 2
1 (Array, 1 element)
target_id (String, 1 characters ) 3
Comment #3
Strutsagget commentedA node test submit in $form_state in hook_form_submit it looks like this
values (Array, 29 elements)
nid (NULL)
.. and some more basic values in values array ....
field_users (Array, 1 element)
und (Array, 3 elements)
0 (Array, 1 element)
target_id (String, 1 characters ) 2
1 (Array, 1 element)
target_id (String, 1 characters ) 3
2 (Array, 1 element)
target_id (String, 2 characters ) 13
Comment #4
Strutsagget commentedWe have tried everything and this is the only field/widget we have never got to work.
I get no errors at all just no users added to the field
one of the examples i have tried
So the nodes are created with title and the right contenttype but no users are added.
Comment #5
Strutsagget commentedHave tried this one also:
Comment #6
marcingy commentedThat is node not form api, as @ygerasimov says you need to provide the correct FAPI structure.
Comment #7
Strutsagget commentedThat is not helping at all. Please dont tell me what dosn't work. If you know how to submit the autcomplete please provide it instead. As you can see i have added the form submit output and nothing works for me so far following all the standard way. Please provide the correct FAPI structure if you know it.
Unfortunately I do think autocomplete with multiple options is a bug right now and is not working.
Please don't mark anything as fixed when you have not help anything to fix the problem.
Comment #8
marcingy commentedSo myself and ygerasimov have told you that you need to look at the form api structure. You can easily discover said structure by going to the form in question and add a dpm in the appropriate submit handler. You will see the structure you need to provide. The structure is totally dependent on the widget selection so there is no one size fits.
Services simply simulates a form submission so if the structure is correct (I have provided how to find this above) then it will just work.
Comment #9
Strutsagget commentedmarcingy i really don't understand why you are posting here as you don't want to read the earlier posts and don't want to help. If i have misunderstood your intentions I apologize. Of course I have read the documentation, i have got mostly every singe field working with services except multiple tag style autocomplete fields. As some fields are really hard to guess how it works even with dpm i come here for help. Someone not reading earlier posts and write RTFM does not help.
I have added the dpm posts (and $form_state) for the field, it was the first thing i added see post #2 and #3. but i can added here again... As a lot of the reference fields is not just look at the dpm output to understand as I am still asking. If it was easy to read from just the dpm and wasn't important i wouldn't ask.
from the code above i see it should be but it isn't:
Comment #10
marcingy commentedI will ignore the personal attack....what is the cardinality of your field? If it is unlimited you may be encountering https://www.drupal.org/node/1985390 and specifically this core issue http://drupal.org/node/1066786.
Also https://www.drupal.org/node/1443712#comment-6694800 might help you.
To get the true FAPI structure you need to go earlier than a submit hook, as by that time validation hooks have tweaked data etc you need to dpm $form_state['input'] in drupal_build_form as this will provide you raw input at the start of form processing.
Comment #11
kylebrowning commented