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

vdirel-contact-fullname fails for entries without N field #10

Open
stettberger opened this issue Aug 2, 2017 · 4 comments · May be fixed by #18
Open

vdirel-contact-fullname fails for entries without N field #10

stettberger opened this issue Aug 2, 2017 · 4 comments · May be fixed by #18

Comments

@stettberger
Copy link

If an entry has no FN and no N entry, the function vdirel-contact-fullname fails.

@DamienCassou
Copy link
Owner

Do you have an example vcard file? What do you expect as result for this?

@DamienCassou
Copy link
Owner

I'm closing this ticket as it hasn't received any activity for some time. Feel free to reopen with an answer to my question.

@dbankmann
Copy link

Just came across the same issue.
Take this vcard for example:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Inverse inc.//SOGo Connector 1.0//EN
UID:C5C1221C-A890-0001-FBCB-16D71F001B16.vcf
X-MOZILLA-HTML:FALSE
EMAIL;TYPE=work:[email protected]
END:VCARD

It fails, because

(replace-regexp-in-string ";" " " nil) fails in vdirel-contact-fullname.

Replacing the according function by, e.g.

(defun vdirel-contact-fullname (contact)
  "Return the fullname of CONTACT."
  (or
   (vdirel--contact-property "FN" contact)
   (if (equal (vdirel--contact-property "N" contact) nil)
       ""
   (replace-regexp-in-string
    ";" " "
    (vdirel--contact-property "N" contact)))))

solves the problem.

@DamienCassou DamienCassou reopened this Nov 3, 2019
@DamienCassou
Copy link
Owner

@dbankmann thank you for the details. Would you mind sending me a PR?

dbankmann pushed a commit to dbankmann/vdirel that referenced this issue Nov 4, 2019
…n error

Now just returns an empty string
dbankmann pushed a commit to dbankmann/vdirel that referenced this issue Nov 4, 2019
…n error

Now just returns an empty string
@peterhoeg peterhoeg linked a pull request May 16, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants