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

Title not coming during create Contact #62

Open
m4mum opened this issue Dec 7, 2018 · 3 comments
Open

Title not coming during create Contact #62

m4mum opened this issue Dec 7, 2018 · 3 comments

Comments

@m4mum
Copy link

m4mum commented Dec 7, 2018

Hi

Got this issue suddenly (earlier it was working fine without any changes).

While creating new Contact, title/full name is not reflected.
Any idea how to solve this?

Thanks

@m4mum
Copy link
Author

m4mum commented Dec 7, 2018

Sorted, someone has already patched from Dec 2 pull request.

@andersoncostasr
Copy link

Change create method in ContactFactory.php
$title = $doc->createElement('gd:name');
$title->setAttribute('fullName', $name);
$entry->appendChild($title);

@tigsdev
Copy link

tigsdev commented Jan 27, 2020

try

   `$cat = $doc->createElement('atom:category');
    $cat->setAttribute('scheme', 'http://schemas.google.com/g/2005#kind');
    $cat->setAttribute('term', 'http://schemas.google.com/contact/2008#contact');
    $entry->appendChild($cat);
    $expl_fullname = explode(" ", $name);

    if(isset($expl_fullname[0])){
        $first_name = $expl_fullname[0];
    }else{
        $first_name = "";
    }

    if(isset($expl_fullname[1])){
        $second_name = $expl_fullname[1];
    }else{
        $second_name = "";
    }

    $title = $doc->createElement('title', $name);
    $entry->appendChild($title);
    
    $gdname = $doc->createElement('gd:name');
    $entry->appendChild($gdname);
    
    $gdname = $doc->createElement('gd:name');
    $entry->appendChild($gdname);
    $givenName = $doc->createElement('gd:givenName', $first_name);
    $familyName = $doc->createElement('gd:familyName', $second_name);
    $fullName = $doc->createElement('gd:fullName',  $name);
    $gdname->appendChild($givenName);
    $gdname->appendChild($familyName);
    $gdname->appendChild($fullName);

    $email = $doc->createElement('gd:email');
    $email->setAttribute('rel', 'http://schemas.google.com/g/2005#work');
    $email->setAttribute('primary', "true");
    $email->setAttribute('address', $emailAddress);
    $email->setAttribute('displayName', $name);
    $entry->appendChild($email);`

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

3 participants