Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Simple select list not accepting value.
Watchdog: Illegal choice in "BU" element.
Warning: Illegal offset type in isset or empty in list_field_validate() (line 394 of /modules/field/modules/list/list.module).
The web service is calling in JSON:
{
"type":"TEST",
"title":"TITLE",
"uid":"1",
"field_mosaic_bu":{ "und": [{"value":"bu name"}] },
"field_mosaic_var1":{ "und": [{ "value":"test1" }] },
"field_mosaic_var2":{ "und": [{ "value":"test2" }] },
"field_mosaic_var3":{ "und": [{ "value":"test3" }] },
"field_mosaic_image":{ "und": [{ "fid":"4" }] }
}
The issue is coming from "field_mosaic_bu" which is a Select list. "bu name" is a correct value.
If I put a plain textfield, it works fine.
Any help would be much appreciated.
This post http://drupal.org/node/1144236 seems to be a similar probleme, but not only contained for select lists.
Comments
Comment #1
marcingy CreditAttribution: marcingy commentedComment #2
Teebo CreditAttribution: Teebo commentedFor those of you who will probably have the same problem, here is the correct way to handle LIST type fields (in ex. below field_mosaic_bu):
Hope this helps someone. Took me a lot of time to figure this out.
Comment #3
marcingy CreditAttribution: marcingy commentedComment #5
KartagisSorry for butting on this, but I've got the same issue, only with checkboxes. Has anyone found a solution for this? In case anyone is interested, here is my question on Drupal Answers.