cozy / cozy-contacts-v2

Contact books manager for Cozy
http://cozy.io
GNU Affero General Public License v3.0
20 stars 20 forks source link

Export doesn't work #199

Closed f6fvy closed 8 years ago

f6fvy commented 8 years ago

v2.1.3

After selecting one or several contacts, the "Export" button shows up, but clicking on it doesn't do anything.

This faulty behavior is the same for the Export button located in the "Setup" dialog.

clochix commented 8 years ago

Hi @f6fvy, Thanks for reporting. Do you see any error inside your browser console, or in server logs?

f6fvy commented 8 years ago

1/ Correction : It doesn't work with "SELECT ALL" contacts checked (or the export button in the settings dialog). If I manually select several contacts, it works...

2/ I get this trace error in the console :+1:


TypeError: a.join is not a function "https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js" 9 43 TypeError: a.join is not a function Trace de la pile : h@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:9:43 u.toVCF@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:8:29516 o</e.prototype.toVCF/<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:2:14846 o</e.prototype.picturetoa@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:2:14735 o</e.prototype.toVCF@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:2:14799 v.invoke/<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:3:24846 v.collect@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:3:23929 v.invoke@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:3:24794 v.mixin/</v.prototype[e]@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:4883 o</r.prototype.bulkExport@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:3:18435 o</r.prototype.viewEvents["bulk:export"]@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:3:16696 v@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:9292 y@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:9101 f@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:7020 l.trigger@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:8994 o._triggerMethod</<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:5:18556 o.View<.triggerMethod@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:5:31945 o.View<._buildViewTrigger/<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:5:31747 Q.event.dispatch@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:2:15757 Q.event.add/m.handle@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:2:12567 h@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:9:43 u.toVCF@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:8:29516 o</e.prototype.toVCF/<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:2:14846 o</e.prototype.picturetoa@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:2:14735 o</e.prototype.toVCF@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:2:14799 v.invoke/<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:3:24846 v.collect@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:3:23929 v.invoke@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:3:24794 v.mixin/</v.prototype[e]@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:4883 o</r.prototype.bulkExport@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:3:18435 o</r.prototype.viewEvents["bulk:export"]@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/app.js:3:16696 v@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:9292 y@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:9101 f@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:7020 l.trigger@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:4:8994 o._triggerMethod</<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:5:18556 o.View<.triggerMethod@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:5:31945 o.View<._buildViewTrigger/<@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:5:31747 Q.event.dispatch@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:2:15757 Q.event.add/m.handle@https://laurenthaas.cozycloud.cc/apps/contacts/scripts/vendor.js:2:12567 app.js:1:8284

TypeError: a.join is not a function vendor.js:9:43


Hope it helps !

clochix commented 8 years ago

Thanks, @f6fvy, It's seems to be the same error also reported on the forum.

Probably in function exportAdr called in VCardParser.toVCF.

clochix commented 8 years ago

@frankrousseau I reproduced the issue and can confirm it's because we call exportAdr whith options.value as a string, while an array is expected. It has already been fixed in Cozy-vcard, so we just need to update the dependency to the latest version of CozyVcard

f6fvy commented 8 years ago

Thanks for your great support.

frankrousseau commented 8 years ago

Great thank you @clochix. I make a PR tonight for this.

f6fvy commented 8 years ago

Ticket update

With version v2.1.4, the export file is now created, but there are no phone numbers (at all) in it ! Same issue with individual (or grouped) selection.

So, for now, the export is still not usable :-(

clochix commented 8 years ago

Seems like another problem with cozy-vcard. I just fixed a typo in the lib, @m4dz would you mind applying this fix by hand on your working directory and see if it fixes the export of tel, address, email and url?

frankrousseau commented 8 years ago

This issue depends on the context. On my Cozy it works well. Maybe that some fields lead to an error. @f6fvy Do you know if your contacts have something special?

f6fvy commented 8 years ago

Most of them don't have address or email if it matters. The phone numbers are using the fields named Cell or Voice or Home. They are displayed in the app without any problem.

But even with one contact selected only, I never get a phone number in the export. Rather strange.

clochix commented 8 years ago

I can confirm, I have the save behavior as @f6fvy, and having a look at our vcard library, I found a typo in the code that may affect export of some fields.

m4dz commented 8 years ago

@clochix cozy-vcard 0.2.17 is now on the development branch. Can you make a try and tell me if it's solved?

poupotte commented 8 years ago

This issue should be fixed in the next version :) .

poupotte commented 8 years ago

This issue is fixed in new release : v2.1.5

f6fvy commented 8 years ago

Yippee ! It's working now ! Thanks @clochix @poupotte @frankrousseau @m4dz et al. !