Customize Headers window is prompted twice (Creating/adding customized filter header or removing it requires to click 'OK' twice)

RESOLVED FIXED in Thunderbird 22.0

Status

MailNews Core
Filters
--
minor
RESOLVED FIXED
8 years ago
4 years ago

People

(Reporter: Aureliano, Assigned: aryx)

Tracking

(Blocks: 1 bug)

1.9.1 Branch
Thunderbird 22.0

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

8 years ago
STR:

1. open a new saved search window using context menu on specific folder;
2. in criterias area select "customize" for open "Customize Headers" window;
3. fill "new message header" with e.g X-Bugzilla-Status and then click Add button;
4. click OK button for unload window: the window is already prompted to user.

It seems to happens also the first time that this operation is raised from a specific folder.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5pre) Gecko/20091026 Lightning/1.0pre Shredder/3.0pre ID:20091026031601
(Reporter)

Updated

7 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 1

6 years ago
It also happens in Filter management (adding custom header). The window reappears twice regardless of button pressed (OK or Cancel).
Still a problem on TB11, linux.
Component: Mail Window Front End → Filters
OS: Windows XP → All
Product: Thunderbird → MailNews Core
QA Contact: front-end → filters
Hardware: x86 → All
Version: 3.0 → 1.9.1 Branch

Comment 2

5 years ago
I can reproduce this consistently on Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0:

Steps to reproduce:
1. Tools->Message Filters….  A "Message Filters" dialog appears.
2. New….  A "Filter Rules" dialog appears.
3. Subject->Customize….  A "Customize Headers" dialog appears.
4. If desired, add or remove a message header.  (This step is optional.)
5. Hit OK or Cancel.

Expected behaviour:
6. The "Customize Headers" dialog should disappear, and focus should return to the "Filter Rules" dialog.

Observed behaviour:
6. The "Customize Headers" dialog reappears.  This time, clicking OK or Cancel will close the dialog.  The bug will no longer occur if you repeat from step 3.  However, the bug will occur again if instead you hit OK or Cancel to close the "Filter Rules" dialog, and then repeat from Step 2.

Comment 3

5 years ago
For some reason, this code is executed twice in /mail/base/content/mailWidgets.xml:
     <property name="parentValue">
        <setter>
          <![CDATA[
            if (this.searchAttribute == val && val != Components.interfaces.nsMsgSearchAttrib.OtherHeader) return val;
            this.searchAttribute = val;
            this.refreshList(true); // don't restore the selection, since searchvalue nulls it
            if (val == Components.interfaces.nsMsgSearchAttrib.OtherHeader)
            {
              window.openDialog('chrome://messenger/content/CustomHeaders.xul', "", 'modal,centerscreen,resizable,titlebar,chrome', null);
              setTimeout(UpdateAfterCustomHeaderChange, 0); // XXX bug 212625
            }
            else if (val == Components.interfaces.nsMsgSearchAttrib.AgeInDays)
            {
              // We want "Age in Days" to default to "is less than".
              this.value = Components.interfaces.nsMsgSearchOp.IsLessThan;
            }
            return val;
          ]]>
        </setter>

I could not yet find out from where this is called.

Comment 4

5 years ago
Confirming bug still exists on Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1

Updated

5 years ago
Summary: Customize Headers window is prompted twice → Customize Headers window is prompted twice (Creating/adding customized filter header or removing it requires to click 'OK' twice)

Updated

5 years ago
Duplicate of this bug: 776344

Updated

5 years ago
Blocks: 382404

Comment 6

5 years ago
And after the customize dialog is closed, it should probably select one of the added headers (if it can be determined).
Duplicate of this bug: 631798
Created attachment 721261 [details] [diff] [review]
patch, v1

What's going on here:

The callstacks for both windows:
#0: function set_parentValue() in <chrome://messenger/content/mailWidgets.xml> line 1703
#1: function set_value() in <chrome://messenger/content/mailWidgets.xml> line 1426
#2: function onSelect() in <chrome://messenger/content/mailWidgets.xml> line 1534
#3: function oncommand() in <chrome://messenger/content/FilterEditor.xul> line 1

#0: function set_parentValue() in <chrome://messenger/content/mailWidgets.xml> line 1703
#1: function onSelect() in <chrome://messenger/content/mailWidgets.xml> line 1539
#2: function oncommand() in <chrome://messenger/content/FilterEditor.xul> line 1

onSelect sets this.value, calling its setter which does the same targets and optargets updating like onSelect, resulting in two calls to parentValue which opens the window.
Assignee: nobody → archaeopteryx
Status: NEW → ASSIGNED
Attachment #721261 - Flags: review?(kent)

Comment 9

4 years ago
Comment on attachment 721261 [details] [diff] [review]
patch, v1

Yes that makes sense. Thanks for the patch.

Could you also submit a patch for the equivalent fix in the SeaMonkey version of this code?
Attachment #721261 - Flags: review?(kent) → review+
Created attachment 722540 [details] [diff] [review]
patch for SeaMonkey, v1

(In reply to Kent James (:rkent) from comment #9)
> Could you also submit a patch for the equivalent fix in the SeaMonkey
> version of this code?

Here you go. Forward the review request if necessary.
Attachment #722540 - Flags: review?(kent)

Updated

4 years ago
Attachment #722540 - Flags: review?(kent) → review?(neil)
Comment on attachment 722540 [details] [diff] [review]
patch for SeaMonkey, v1

[What's left of onSelect could probably be inlined into the caller...]
Attachment #722540 - Flags: review?(neil) → review+
Created attachment 723182 [details] [diff] [review]
patch for Thunderbird, v2, r=rkent
Attachment #721261 - Attachment is obsolete: true
Created attachment 723183 [details] [diff] [review]
patch for SeaMonkey, v2, r=Neil
Attachment #722540 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/9737e2f98425
https://hg.mozilla.org/comm-central/rev/c164453b2b01
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 22.0

Updated

4 years ago
Attachment #723183 - Attachment is patch: true
You need to log in before you can comment on or make changes to this bug.