lucc / khard

Console vcard client
https://khard.readthedocs.io/en/latest/
GNU General Public License v3.0
600 stars 65 forks source link

only one address shown when editing a contact with multiple {home,work} addresses #323

Closed lemmerk closed 1 year ago

lemmerk commented 1 year ago

i can save a contact with multiple home addresses. using khard show first last i see the following:

Name: first last
Full name: first last
Address book: contacts
Kind: individual
Phone
    cell:
        - 123
        - 456
        - 789
E-Mail
    home:
        - 01@home.tld
        - 02@home.tld
        - 03@home.tld
Address
    home:
        -
            street 1
            00001 city01
            country01
        -
            street 2
            00002 city02
            country02
        -
            street 3
            00003 city03
            country03
Miscellaneous
    UID: 3vijrweg08clpmpf8hoobu2pelizf8xxo6pl

when i edit the contact using khard edit first last, i am only shown one of the addresses:

Phone:
    cell:
      - '123'
      - '456'
      - '789'

# email addresses
# format like phone numbers above
# allowed types:
#   vcard 3.0: At least one of home, internet, pref, work, x400
#   vcard 4.0: At least one of home, internet, pref, work
#   Alternatively you may use a single custom label (only letters).
Email:
    home:
      - 01@home.tld
      - 02@home.tld
      - 03@home.tld

# post addresses
# allowed types:
#   vcard 3.0: At least one of dom, intl, home, parcel, postal, pref, work
#   vcard 4.0: At least one of home, pref, work
#   Alternatively you may use a single custom label (only letters).
Address:
    home:
        Box:
        Extended:
        Street: street 1
        Code: '00001'
        City: city01
        Region:
        Country: country01

when editing the vcard using khard edit --format vcard first last, everything seems to be in order:

BEGIN:VCARD
VERSION:4.0
UID:3vijrweg08clpmpf8hoobu2pelizf8xxo6pl
ADR;TYPE=home:;;street 1;city01;;00001;country01
ADR;TYPE=home:;;street 2;city02;;00002;country02
ADR;TYPE=home:;;street 3;city03;;00003;country03
EMAIL;TYPE=home:01@home.tld
EMAIL;TYPE=home:02@home.tld
EMAIL;TYPE=home:03@home.tld
FN:first last
N:last;first;;;
REV:20230906T075413Z
TEL;TYPE=cell;VALUE=uri:tel:123
TEL;TYPE=cell;VALUE=uri:tel:456
TEL;TYPE=cell;VALUE=uri:tel:789
END:VCARD

the same applies for multiple other addresses. only every one of the multiples is shown in the .yaml file.

i think this used to work as expected. unfortunately i'm not sure when this stopped working for me. is this a setting of mine or a bug?

hope i didn't miss a duplicate of this issue.

Khard version 0.18.0

lucc commented 1 year ago

Yep that's a bug :(

I assume it exists since 9ab66ac. I have a failing test for your issue in #324.