Open max1020 opened 10 years ago
I agree - checkboxes are not working. I had to use an integer for one project, but I hope there will be a way to make legitimate checkbox boolean fields work. Have you had any luck with this?
any solution ?
Not yet - I'm just using integers.
hello Joe,
nope, i had no success with the checkboxes and taxonomy terms unfortunately.
but its a good suggestion with the integer. many thanks!
ill use the integer fields in the drupal backend instead of checkboxes and add a comment in the readme file. i spent quite a bit of time on this.
cheerios,
Hi all,
I found ths solution for checkBox and SelectField hhh :
function selectListField(value){ var selectList = { "und": [value] }; return selectList; }
function checkBoxField(value){ var checkBox = { "und": value }; return checkBox; }
Example :
var a = "a"; var user = {name:a, current_pass:a, mail:'test@example.com', field_boolean : checkBoxField("non") };
hey!
would be great if that did the trick - im gonna try this later this week and provide feedback. thanks in any case.
As always, pull requests appreciated.
hello medrockstar,
did you manage to get the checkbox function to work? i didnt - see the attached screenshot. the json structure is different when using the checkbox function.
also, drupal services seems to return only "1" and "0" (regardless of what is entered as "on" and "off" value in the drupal boolean field).
here is part of the object what works for me (text fields instead of boolean). titanium returns switch values of "true"and "false" (whereas drupal works with "0" and "1" so i used a text field)
field_serious_ch: drupal.field.structureField("" + $.serious.value + ""),
field_fun_ch: drupal.field.structureField("" + $.fun.value + ""),
field_politics_ch: drupal.field.structureField("" + $.politics.value + ""),
i have 3 switches called serious, fun and politics.
Hello Joe,
Great to see that you continue to work on this project. ive picked up working on the documentation and the app again so i thought id report this issue here. im using services 3.7 but this shouldnt have an impact on the checkboxes, no?
its primarily about checkboxes (on user profile) that are not being updated (or set to "0" in the example). the decimal and text fields are correctly updated when passing the object to the drupal.putResource function.
Ive attached a screenshot as well showing details about this (taxonomy terms are not mentioned in the README file, so i guess you are aware of that). ive tried all widgets for taxonomy terms (also autocomplete doesnt work, this works with an organic group reference field though).
cheerios,