Last Comment Bug 653859 - Filter won't save if tags is empty is set
: Filter won't save if tags is empty is set
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Filters (show other bugs)
: Trunk
: x86 All
: -- minor (vote)
: Thunderbird 15.0
Assigned To: :aceman
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-29 15:53 PDT by Kent James (:rkent)
Modified: 2012-04-25 07:05 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
fix (782 bytes, patch)
2011-12-10 16:04 PST, :aceman
rkent: review+
Details | Diff | Review

Description Kent James (:rkent) 2011-04-29 15:53:50 PDT
STR:

1) Create a message filter with the single search term "Tags Is Empty" and no assigned name.

2) Save.

The filter is not saved, and the filter editor dialog stays open. Error console says:

Error: [Exception... "Index or size is negative or greater than the allowed amount"  code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"  location: "chrome://messenger/content/FilterEditor.js Line: 445"]
Source File: chrome://messenger/content/FilterEditor.js
Line: 183

This is originating actually from line 445:


441    // Assign a name based on the first search term.
442    let searchValue = termRoot.searchvalue;
443    let selIndex = searchValue.getAttribute( "selectedIndex" );
444    let children = document.getAnonymousNodes(searchValue);
445    let activeItem = children[selIndex];

Workaround: assign a name to the filter.
Comment 1 :aceman 2011-11-12 09:46:49 PST
I do not understand this. How do you create "Tags is Empty"? When I choose field Tags I get the list of tag names in the value field (like Important, Work, etc). Where is the "empty" value?
Comment 2 :aceman 2011-12-10 14:51:57 PST
I see now, you put that in the conditions list, not actions.
Nowadays in TB11, clicking OK does nothing (as you report), but the error console contains:

Error: activeItem is undefined
Source File: chrome://messenger/content/FilterEditor.js
Line: 481
Comment 3 :aceman 2011-12-10 16:04:33 PST
Created attachment 580696 [details] [diff] [review]
fix

The proposed fix produces a filter name of "Tags is empty:". The colon is superfluous, but I am not sure it is worth it to pursue killing it.
Comment 4 Kent James (:rkent) 2011-12-15 14:43:35 PST
I've been having a hard time getting my trunk debug build to work, plus today I was unable to download the attachment for the fix (might be an intermittent bugzilla error). Anyway I've not forgotten about this. I'll try again in a day or so.
Comment 5 :aceman 2012-03-06 05:03:54 PST
rkent, any success now?
Comment 6 Kent James (:rkent) 2012-04-24 15:19:09 PDT
Comment on attachment 580696 [details] [diff] [review]
fix

I looked at this patch as well as tested it, and it works fine. Thanks for fixing this!(and sorry to be so slow nyself!)
Comment 7 :aceman 2012-04-25 00:23:51 PDT
Thanks.
Comment 8 Mark Banner (:standard8) 2012-04-25 07:05:46 PDT
Checked in: https://hg.mozilla.org/comm-central/rev/251fab15820b

Note You need to log in before you can comment on or make changes to this bug.