Tagged: xprofile
Hi, I’m copying a code snippet to import the data sent from a form to the buddypress profile. This works well. Except the field_87 that the value is a string (there are several locations) and when I choose option * multiple selection box * for example this is show separated by commas and when I edit it, it is empty.
Any idea how I can add this value separately in an xprofile?
for example if I choose the option in a text box it appears: “France, Paris, Buenos Aires, Argentina” when i wrote two locations. i hope you can me understand me.` $usermeta = array(
//name
‘field_1’ => $form->getValueText(‘quform_7_10’),
‘field_59’ => ‘Home’,
//multiple locations
‘field_87’ => $form->getValueText(‘quform_7_23’),);
$usermeta[‘profile_field_ids’] = ‘1,43,59’;`
Thanks very much!
Hi Jennifer,
The multi option values are stored as serialized value. Can you please check from your import that the field id has data in serialised form? Also, to be editable(selected on edit page, they will be case sensitive).Regards
BrajeshHi Brajesh. thanks for your answer!
No, it isnt.do you mean add something like that?$(document).ready(function(){ $("button").click(function(){ $("div").text($("form").serialize()); }); });
I m thinking that the answer is generate like a repeater fields in xprofile but i didnt know how i can begin
Hi Jennifer,
No, Not that.
I was referring to this.
1. Keep the values in array e.g $val = array(“OPT1”, “OPT2”);
2. Then serializing it using something like this $serialized = maybe_searialize($val).Then you can store that value.
Regards
BrajeshHi Jennifer,
I was referring for the BuddyPress core multi fields(checkbox/select).You are most probably using a custom implementation for the repeater field. Please consult the developer on how to store it in the database. It may have a different strategy for storing.
Regards
Brajesh
You must be logged in to reply to this topic.