Help with set_value
Hi.
I'm using the newest podio api version.
My App has 2 fields:
FIELD 1: Type "app". External id 'select-a-supplier'.
FIELD 2: Type "text" external id 'please-explain'.
Here's my code:
$field1 = $item->field('select-a-supplier');
$field1->set_value(array(55559591,55559583)); //these are 2 items ids I want to link to
$field2 = $item->field('please-explain');
$field2->set_value('hello world'); //this should update the field
$item->save();
55559591 and 55559583 both exists. Are valid items.
Before I run the code, field 'select-a-supplier' exists and is populated linking to another app so I don't need to create a new 'select-a-supplier' field, just needs to be updated.
When the code runs $item gets updated !!! I can go to podio and see the $item was updated. Field2 'please-explain' gets updated too. I can see the 'hello world' updated. So far so good...
BUT....
Field2 'select-a-supplier' doesn't get updated. When I run it clears all previous data on this field like if set_value was an empty string. I guess something's wrong when I'm calling set_value.
I get a warning message: "array_map() expects parameter 1 to be a valid callback, no array or string given in PodioItemField.php on line 95"
I tried everything. I read ALL posts here.
Any ideas what might be happening?
Thank you very much.
Please sign in to leave a comment.
Comments
3 comments