Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Contact Name After Update Contact #65

Open
RynC1999 opened this issue Sep 2, 2019 · 3 comments
Open

Missing Contact Name After Update Contact #65

RynC1999 opened this issue Sep 2, 2019 · 3 comments

Comments

@RynC1999
Copy link

RynC1999 commented Sep 2, 2019

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);`
@AbdullahEliwa
Copy link

AbdullahEliwa commented Oct 1, 2019

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.

@h-a-r-d-i-k
Copy link

Does anyone solved this issue?

@sunnybear
Copy link

sunnybear commented Apr 4, 2020

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants