Closed Bug 1653647 Opened 4 years ago Closed 4 years ago

Edit vCard dialog does not have a title when creating new vCard

Categories

(Thunderbird :: Address Book, defect)

defect

Tracking

(thunderbird_esr60 unaffected, thunderbird_esr68 unaffected, thunderbird_esr78 fixed, thunderbird77 unaffected, thunderbird78 wontfix, thunderbird79 wontfix, thunderbird80 affected, thunderbird81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
thunderbird_esr60 --- unaffected
thunderbird_esr68 --- unaffected
thunderbird_esr78 --- fixed
thunderbird77 --- unaffected
thunderbird78 --- wontfix
thunderbird79 --- wontfix
thunderbird80 --- affected
thunderbird81 --- fixed

People

(Reporter: thomas8, Assigned: mkmelin)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files, 2 obsolete files)

Seen on 79.0b1 (32-bit), Win10

STR:

  • Account Settings > Edit Card

Actual:

  • The vCard dialog does not have a title when empty (first use; will never be empty again as TB doesn't allow me to empty an existing vCard, which feels wrong, too).

Expected:

  • Button label should be Edit vCard
  • Virgin vCard dialog (when creating a new vCard) should have title: Edit vCard
  • As with AB contacts, as user enters names, title should change dynamically to Edit vCard for {DisplayName}
Blocks: tb78found

Seems the issue is the identity.escapedVCard element has the string value "null", which is also found in the prefs written to disk. Not sure exactly what caused it go get there.

That the value is "null" will make the card parser not happy. But there are also other brokenness in this area, apparently since a very long time we're referencing field ids we do not have.

Attached patch bug1653647_ab_vcard.patch (obsolete) — Splinter Review

Not sure what was different from before, I guess the VCardUtils.jsm checks in this patch would make a difference. But like a wrote, not sure about the root cause. And we may have to run a migration to kill off "null" in the pref values.

For the non-vcard values, Nickname is vCard thing, as well as custom fields (should be x-foo properties). Secondary email we should be able to enable as email[1] but I guess that's not quite done yet. The chat part... needs a bunch of rethinking and I guess we should weed out irrelevant/dead/non-standard protocols we do not support. Or figure out what's the best mapping in proper vcard...

Any input?

Assignee: nobody → mkmelin+mozilla
Attachment #9168431 - Flags: feedback?(geoff)
Status: NEW → ASSIGNED
Blocks: 1653187

Comment on attachment 9168431 [details] [diff] [review]
bug1653647_ab_vcard.patch

That seems reasonable. Why are you changing it to disable the fields instead of hiding them?

I think abCardToVCard and vCardToAbCard were supposed to deal with nulls properly at some point but that must've got lost along the way. Wrapping in encodeURIComponent would still produce "null" anyway so we'd still have that problem. :-/

Attachment #9168431 - Flags: feedback?(geoff) → feedback+

I'd like to avoid adding more wrapping boxes, which would kind of be needed to do the hiding. When I disable, I don't need to think about the label.

If this is causing bug 1653187 then severity s3 is more appropriate.

See Also: → 1659321
Attached patch bug1653647_ab_vcard.patch (obsolete) — Splinter Review

Slightly updated.
It's possible my initial take on the problem was a red herring: I tried but couldn't reproduce an identity.escapedVCard null value in the prefs. I guess it was in my testing profile and caused by some testing of whatever feature during the betas. So, I think we can just ignore that unless we find it's more widely spread.

I also added an hbox for the preferDisplayName - looked bad when opened from the account settings tab otherwise, due to the fatter subdialog styling making it wrap.

Attachment #9168431 - Attachment is obsolete: true
Attachment #9170893 - Flags: review?(geoff)
Comment on attachment 9170893 [details] [diff] [review]
bug1653647_ab_vcard.patch

Review of attachment 9170893 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/components/addrbook/content/abCard.js
@@ +9,5 @@
>  var { MailServices } = ChromeUtils.import(
>    "resource:///modules/MailServices.jsm"
>  );
>  
> +var kNonVcardFields = ["SecondEmail", "ChatName", "preferDisplayName"];

SecondEmail works now, so it could be removed from this list.

@@ +173,5 @@
>      abPopup.hidden = true;
>      document.getElementById("abPopupLabel").hidden = true;
>    }
>  
> +  SetCardDialogTitle(gEditCard.card ? gEditCard.card.displayName : null);

gEditCard.card is always truthy, it's set earlier in this function.

@@ +179,5 @@
>    GetCardValues(gEditCard.card, document);
>  
> +  // Focus on first or last name based on the pref of which is first.
> +  var input = document.getElementById(
> +    gEditCard && gEditCard.displayLastNameFirst ? "LastName" : "FirstName"

Again, gEditCard is always truthy.

@@ +184,2 @@
>    );
> +  input.focus();

This doesn't appear to work, when opening from the account settings. I suspect it does work, but then it's overruled, so it looks like the timeout was doing something useful after all.

That aside, I think `input.select()` would be better.
Attachment #9170893 - Flags: review?(geoff) → review+

Thanks, making sure the card was set (or rather, not unset, set to null) was done in a later stage of the patch.

Attachment #9170893 - Attachment is obsolete: true
Attachment #9171124 - Flags: review+
Target Milestone: --- → 81 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/f58aa47173cb
use mime encoded version of the mailbox string where needed, so that non-ASCII or commas don't cause problems. r=pmorris
https://hg.mozilla.org/comm-central/rev/f13c60c8dbf0
fix Edit vCard dialog brokenness. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

Only bug https://hg.mozilla.org/comm-central/rev/f13c60c8dbf0 belonged in this bug.
Will back out the other and reland with the correct bug number.

Backout by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/613d10d61acc
Backed out changeset f58aa47173cb for landing with wrong bug number: bug 1653647, should have been bug 1656278)

Comment on attachment 9171124 [details] [diff] [review]
bug1653647_ab_vcard.patch

[Approval Request Comment]
Regression caused by (bug #): unknown
User impact if declined: Can't edit vCard to send
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): not risky, it's quite broken as is

Attachment #9171124 - Flags: approval-comm-esr78?

Comment on attachment 9171124 [details] [diff] [review]
bug1653647_ab_vcard.patch

[Triage Comment]
Approved for esr78

Attachment #9171124 - Flags: approval-comm-esr78? → approval-comm-esr78+
Component: Preferences → Address Book
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: