The generated .vcf file will not import into contacts - I get the message "No importable cards were found.". I have tried on both my apple contacts on my mac and my google contacts in my gmail account. Pathauto is installed and up to date.

Here is what I noticed:
The generated .vcf file contains twig comments before the BEGIN and after the END notations. Also there are numerous blank lines inbetween data. I have attached my .vcf (saved as a .txt file so it would upload here).

If I remove the comments and all the blank lines and whitespace. It imports. Any ideas how to get the code to strip the blank lines or not add them, as well as the twig comments?

CommentFileSizeAuthor
alex-romano-vcf.txt1.03 KBmecurran

Comments

mecurran created an issue. See original summary.

mecurran’s picture

also tried it with 8.x - 2.xdev. Same results.

mecurran’s picture

I have some log errors as well that I am currently trying to decipher. There are a handful of errors all coming from this location:
http://melick-porter/admin/structure/views/ajax/display/attorney_node_di...

I am going to put them in a text file so I can trying to work through them. I will post it here as well.

mecurran’s picture

upgraded core from 8.5.2 to 8.5.4, errors in log went away. no change in vcard behavior - still has space.

neograph734’s picture

Category: Bug report » Support request

It seems that theme debug mode is enabled. This is a development feature that should not be running in a production environment. Once you disable that, vcards should work as expected. Have a look here: https://www.drupal.org/docs/8/theming/twig/debugging-twig-templates.
Please let me know if that resolves your issue.

IMO this is not a bug of this module.

mecurran’s picture

Thank you - that resolved the issue. I agree, it is certainly not a bug. ... But it was not readily apparent to me that twig debug comments would appear in a produced file. Perhaps a mention in the README might be helpful to others that come across this issue and save them a lot of time :)

neograph734’s picture

Title: .vcf will not import » Notify users that vcards will be broken if the site is in theme debug mode
Version: 8.x-2.1 » 8.x-2.x-dev
Category: Support request » Task

Glad to hear your issue was solved. I believe this to be an edge case, so covering it in the README does not make much sense to me. I could however try to cover this on the status report page. If theme debug mode is enabled the system should throw some alert that vcards will not work.

Renaming the issue accordingly.

  • Neograph734 committed e3b91d1 on 8.x-2.x
    Issue #2978557 by mecurran: Notify users that vcards will be broken if...
neograph734’s picture

Status: Active » Fixed

I've added a warning to the latest dev release that should solve this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.