php-google-contacts-v3-api icon indicating copy to clipboard operation
php-google-contacts-v3-api copied to clipboard

Missing Contact Name After Update Contact

Open RynC1999 opened this issue 4 years ago • 3 comments

i want to update contact data, but when i updated the data, the contact name has been missing. this is my code

` $contact->name = 'Test'; $contact->phoneNumber = '081234567890'; $contact->email = '[email protected]';

$contactAfterUpdate = rapidweb\googlecontacts\factories\ContactFactory::submitUpdates($contact);

var_dump($contactAfterUpdate);`

RynC1999 avatar Sep 02 '19 08:09 RynC1999

hah, this is what happened to me just right now, and i was going to write a new issue and found yours, maybe i will rewrite my code and use google api directly now.

AbdallahEliwa avatar Oct 01 '19 07:10 AbdallahEliwa

Does anyone solved this issue?

h-a-r-d-i-k avatar Mar 05 '20 16:03 h-a-r-d-i-k

You need to manually edit proper methods. Name XML has structure

<gd:name>
     <gd:givenName>Elizabeth</gd:givenName>
     <gd:familyName>Bennet</gd:familyName>
     <gd:fullName>Elizabeth Bennet</gd:fullName>
  </gd:name>

So in my case I've added to factories/ContactFactory.php (create):

$n = $doc->createElement('gd:name'); $nn = $doc->createElement('gd:givenName', $name); $n->appendChild($nn); $entry->appendChild($n);

sunnybear avatar Apr 04 '20 22:04 sunnybear