I am new to the list, and new to developing for roundcube so sorry if I am asking a stupid question.
I am working on the google_contacts plugin for the 0.6 version. I am having trouble getting all the fields in the Vcard to save. Specifically I am trying to save the X-AB-EDIT: field and it never saves yet the rest of the data in my vcard saves just fine. Here is my code.
First of all, the $vcard variable holds the entire vcard including the X-AB-EDIT
$vc = rcube_vcard::import($vcard); $email = $vc[0]->email[0]; $a_record = $vc[0]->get_assoc(); $a_record['ab-edit']=$val->edit; $a_record['vcard'] = $vc[0]->export(); $CONTACTS->update($insert_id[0],$a_record);
it saves the contents of $vcard perfectly, just not my field X-AB-EDIT: Any clues why?
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Tue, May 17, 2011 at 06:22, rc rc@deltatechnicalservices.com wrote:
I am new to the list, and new to developing for roundcube so sorry if I am asking a stupid question.
I am working on the google_contacts plugin for the 0.6 version. I am having trouble getting all the fields in the Vcard to save. Specifically I am trying to save the X-AB-EDIT: field and it never saves yet the rest of the data in my vcard saves just fine. Here is my code.
First of all, the $vcard variable holds the entire vcard including the X-AB-EDIT
$vc = rcube_vcard::import($vcard); $email = $vc[0]->email[0]; $a_record = $vc[0]->get_assoc(); $a_record['ab-edit']=$val->edit; $a_record['vcard'] = $vc[0]->export(); $CONTACTS->update($insert_id[0],$a_record);
it saves the contents of $vcard perfectly, just not my field X-AB-EDIT: Any clues why?
rcube_contacts::update() is meant for saving contact data from the Roundcube UI and only saves known and mapped fields. But if you have the X-AB-EDIT field already in $vcard, you don't need to worry about it. It'll be kept in the vcard block.
But why are you actually writing google contacts data to the local contacts database?
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80