Closed Bug 1153543 Opened 9 years ago Closed 9 years ago

when adding a new identity, the smtp server menulist is collapsed with no default item selected

Categories

(MailNews Core :: Account Manager, defect)

defect
Not set
normal

Tracking

(thunderbird38+ fixed, thunderbird39 fixed, thunderbird40 fixed)

RESOLVED FIXED
Thunderbird 40.0
Tracking Status
thunderbird38 + fixed
thunderbird39 --- fixed
thunderbird40 --- fixed

People

(Reporter: aceman, Assigned: aceman)

Details

Attachments

(1 file, 3 obsolete files)

When adding a new identity, the smtp server menulist is collapsed with no default item selected. The code intends to select the default SMTP server, but it didn't pan out correctly.

The error can be seen only when the accounts default identity has SMTP server set to "use default server", which means the .smtpServerKey returns null.
Attached patch patch (obsolete) — Splinter Review
So the default menuitem in the menulist has a value of "" but the default server key is null. That is already solved for existing identities, but not in the code branch for a new identity.
Attachment #8591224 - Flags: review?(mkmelin+mozilla)
Attachment #8591224 - Flags: review?(iann_bugzilla)
Comment on attachment 8591224 [details] [diff] [review]
patch

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

::: mailnews/base/prefs/content/am-identity-edit.js
@@ +41,5 @@
>      document.getElementById('identity.attachVCard').checked = identity.attachVCard;
>      document.getElementById('identity.escapedVCard').value = identity.escapedVCard;
>  
>      document.getElementById('identity.smtpServerKey').value =
> +      identity.smtpServerKey || ""; // useDefaultItem.value is "" but key can be null.

the "but key can be null." addition is confusing IMHO
Attachment #8591224 - Flags: review?(mkmelin+mozilla) → review+
Attached patch patch v1.1 (obsolete) — Splinter Review
OK.
Attachment #8591224 - Attachment is obsolete: true
Attachment #8591224 - Flags: review?(iann_bugzilla)
Attachment #8591743 - Flags: review?(iann_bugzilla)
Comment on attachment 8591743 [details] [diff] [review]
patch v1.1

>+++ b/mailnews/base/prefs/content/am-identity-edit.js
>+    // useDefaultItem.value is "" but smtpServerKey returns null for that case
>     document.getElementById('identity.smtpServerKey').value =
>-      identity.smtpServerKey || ""; // useDefaultItem.value is ""
>+      identity.smtpServerKey || "";
>   }
>   else
>   {
>     // We're adding an identity, use the best default we have.
I would prefer something is added to this comment (similar to the one at the start of this patch) rather than the one below.
>     document.getElementById('identity.smtpServerKey').value =
>-      gAccount.defaultIdentity.smtpServerKey;
>+      gAccount.defaultIdentity.smtpServerKey || ""; // useDefaultItem.value is ""
r=me with that addressed.
Attachment #8591743 - Flags: review?(iann_bugzilla) → review+
Attached patch patch v1.2 (obsolete) — Splinter Review
What about this?
Attachment #8591743 - Attachment is obsolete: true
Attachment #8592447 - Flags: review?(iann_bugzilla)
Comment on attachment 8592447 [details] [diff] [review]
patch v1.2

>+  function initSmtpServer(aServerKey) {
>+    // Select a server in the SMTP server menulist by its key.
>+    // But the value of the identity.smtpServerKey is null
>+    // when the "use default server" option is used. If we get that passed in,
>+    // select the useDefaultItem representing this option, with value of "".
The following seems to flow better:
// Select a server in the SMTP server menulist by its key.
// The value of the identity.smtpServerKey is null when the
// "use default server" option is used so, if we get that passed in, select
// the useDefaultItem representing this option by using the value of "".

r=me with that or something similar
Attachment #8592447 - Flags: review?(iann_bugzilla) → review+
Attached patch patch v1.3Splinter Review
I am no native English speaker so I am fine with whatever you propose :) If it contains the wanted idea.
Attachment #8592447 - Attachment is obsolete: true
Attachment #8592465 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/3677ad2ad8c0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 40.0
Is TB 38 affected by this?
Yes, it is. Using mxr diff on the file it seems the code missing '|| ""' was there forever, at least since TB 1.9.1. So it is not a recent regression. But it is nice polish, possibly unrisky.
Comment on attachment 8592465 [details] [diff] [review]
patch v1.3

[Approval Request Comment]
Regression caused by (bug #): 
User impact if declined: 
Testing completed (on c-c, etc.): 
Risk to taking this patch (and alternatives if risky):
Attachment #8592465 - Flags: approval-comm-beta?
Attachment #8592465 - Flags: approval-comm-aurora?
Comment on attachment 8592465 [details] [diff] [review]
patch v1.3

http://hg.mozilla.org/releases/comm-aurora/rev/02317417c674
Attachment #8592465 - Flags: approval-comm-aurora? → approval-comm-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: