Closed Bug 219122 Opened 22 years ago Closed 21 years ago

Forgetting to select a target folder causes new filter not to be created.

Categories

(MailNews Core :: Filters, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha4

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Keywords: fixed1.7.5)

Attachments

(2 files, 5 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 If you forget to select a target folder whilst creating a new filter, the filter does not get created once the target folder has been selected. Reproducible: Always Steps to Reproduce: 1. Select Tools|Message Filters 2. Select New 3. Enter name "Test" (for example) 4. After "Subject" "contains" enter "test" (or any other string) 5. Check "Move to Folder" 6. Select "OK" 7. A dialog is presented that says "You must select a target folder" 8. Select "OK" 9. Select a target folder. 10. Select "OK" Actual Results: The "filter rules" dialog disappears, no filter is created. msgFilterRules.dat is not updated. Restarting mozilla (or message filter dialog) does not solve the problem either Expected Results: A new filter should have been created with the required details.
*** This bug has been marked as a duplicate of 206627 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
confirmed in 1.6
Status: UNCONFIRMED → NEW
Ever confirmed: true
FYI: Just upgraded to 1.6 and it still exists for me.
I have a potential bug fix for this, but need to test it and I'm away for the next few days. Will upload it when I have time and have read all the "hacking" information.
Attached patch FilterEditor.js fix (obsolete) — Splinter Review
Note: this attachment requires the v3 patch from bug 233091 to be applied before the patch. Bug fix for test case above, also for the following test case: 1. Ensure a filter already exists. 1. Select Tools|Message Filters 2. Select Edit 3. Deselect all actions 4. Select OK 5. Acknowledge Failure 6. Select Cancel 7. Select Filter just edited 8. Select Edit Failure Result: no actions are selected but they should have been. Result with fix: actions are selected as they were previously.
Ok, not quite a dependency, but adding link to bug 233091 to show it needs to be checked in before this one. Feel free to remove it if I've got dependencies wrong.
Depends on: 233091
Comment on attachment 143226 [details] [diff] [review] FilterEditor.js fix Requesting review - have checked test cases and pre-checkin tests against latest trunk.
Attachment #143226 - Flags: review?(sspitzer)
Comment on attachment 143226 [details] [diff] [review] FilterEditor.js fix >+ if (!gMoveToFolderCheckbox.checked && >+ !gChangePriorityCheckbox.checked && >+ !gLabelCheckbox.checked && >+ !gMarkReadCheckbox.checked && >+ !gMarkFlaggedCheckbox.checked && >+ !gDeleteCheckbox.checked && >+ !gWatchCheckbox.checked && >+ !gKillCheckbox.checked && >+ !gDeleteFromServerCheckbox.checked) My personal taste would be |if (!(... || ...))|.
Attachment #143226 - Attachment is obsolete: true
Attachment #143226 - Flags: review?(sspitzer)
Attached patch FilterEditor.js fix v2 (obsolete) — Splinter Review
Incorporated comments from comment 8 - I agree it looks better.
Attachment #143304 - Flags: review?(sspitzer)
Mark, you might get quicker results on your patch if you ask someone besides Seth for review.
Comment on attachment 143304 [details] [diff] [review] FilterEditor.js fix v2 No review from sspitzer since 2004-03-08
Attachment #143304 - Flags: review?(sspitzer)
Attached patch FilterEditor.js fix v3 (obsolete) — Splinter Review
Updated patch to accomodate latest changes in code. Retested to same as before.
Attachment #143304 - Attachment is obsolete: true
Attachment #149716 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 149716 [details] [diff] [review] FilterEditor.js fix v3 >@@ -387,7 +388,11 @@ > { > var isNewFilter; > var filterAction; >+ var targetUri; > >+ // All checks for correct filter details must be performed before >+ // creating/editing the new gFilter. Otherwise problems occur with >+ // the filter. See bug #219122 |Otherwise problems occur with + // the filter. See bug #219122| might not be needed. > var filterName= gFilterNameElement.value; > if (!filterName || filterName == "") > { >@@ -398,6 +403,50 @@ > return false; > } > >+ if (!(gMoveToFolderCheckbox.checked || >+ gChangePriorityCheckbox.checked || >+ gLabelCheckbox.checked || >+ gJunkScoreCheckbox.checked || >+ gMarkReadCheckbox.checked || >+ gMarkFlaggedCheckbox.checked || >+ gDeleteCheckbox.checked || >+ gWatchCheckbox.checked || >+ gKillCheckbox.checked || >+ gDeleteFromServerCheckbox.checked)) It bitrotted again, due to r1.85: |gFetchBodyFromServerCheckbox.checked| addition :-| >+ { >+ if (gPromptService) >+ gPromptService.alert(window, null, >+ gFilterBundle.getString("mustSelectAction")); >+ return false; >+ } >+ >+ if (gActionTargetElement) >+ targetUri = gActionTargetElement.getAttribute("uri"); >+ if (gMoveToFolderCheckbox.checked && >+ (!targetUri || targetUri == "")) |if (gMoveToFolderCheckbox.checked| should stay the first test, before |if (gActionTargetElement)|: |targetUri| won't be used if |gMoveToFolderCheckbox| is not checked. >+ { >+ if (gPromptService) >+ gPromptService.alert(window, null, >+ gFilterBundle.getString("mustSelectFolder")); >+ return false; >+ } >+ >+ if (!gActionPriority.selectedItem) >+ { >+ if (gPromptService) >+ gPromptService.alert(window, null, >+ gFilterBundle.getString("mustSelectPriority")); >+ return false; >+ } >+ >+ if (!gActionLabel.selectedItem) >+ { >+ if (gPromptService) >+ gPromptService.alert(window, null, >+ gFilterBundle.getString("mustSelectLabel")); >+ return false; >+ } Same: these two should be |if (xyz.checked && !yyy.selectedItem)|. Then, Label and Priority are lists with default values: You should be able to remove these tests altogether ! (as the |gJunkScoreCheckbox.checked| case is) I don't know if this applies to Folder too ?? >+ > if (!gFilter) > { > gFilter = gFilterList.createFilter(gFilterNameElement.value);
Attachment #149716 - Attachment is obsolete: true
Attachment #149716 - Flags: review?(neil.parkwaycc.co.uk) → review-
(In reply to comment #13) > Then, Label and Priority are lists with default values: > You should be able to remove these tests altogether ! (as the > |gJunkScoreCheckbox.checked| case is) > I don't know if this applies to Folder too ?? Answers are: remove L and P; keep F :-> [Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040608] (<-- 1.7rc3 !) (W98SE) Confirming bug on Windows...
OS: Linux → All
Hardware: PC → All
Summary: Forgetting to select a target folder causes new filters not to be created. → Forgetting to select a target folder causes new filter not to be created.
Assigning to myself (after conversation with Asa) as I'm working on this.
Assignee: sspitzer → mark
Status: NEW → ASSIGNED
Attached patch FilterEditor.js fix v4 (obsolete) — Splinter Review
Updated to incorporate latest changes and gautheri's review comments.
Attachment #156298 - Flags: review?(gautheri)
Comment on attachment 156298 [details] [diff] [review] FilterEditor.js fix v4 Then, you should remove {{ /mailnews/base/search/resources/locale/en-US/filter.properties, line 2 -- mustSelectPriority=You must select a priority. /mailnews/base/search/resources/locale/en-US/filter.properties, line 3 -- mustSelectLabel=You must select a label }} too ;-) Previously, you used to remove the {{ 535 if (gFilter.actionList.Count() <= 0) }} block. Does it have to be kept now ?? ***** Note that I'm not an actual reviewer; I jumped in to "r-" ... but I can't give a r+ when the time comes. (see <http://www.mozilla.org/owners.html>)
Attachment #156298 - Attachment is obsolete: true
Attachment #156298 - Flags: review?(gautheri) → review-
Updated as per Gautherie's comments - had forgotten about if (gFilter.actionList.Count() <= 0) & didn't know about the other. Hopefully good for review now. ;-)
Attachment #156373 - Flags: review?(neil.parkwaycc.co.uk)
(In reply to comment #18) > Created an attachment (id=156373) > Filter fix v5 > > Hopefully good for review now. ;-) It looks good to me...
Attachment #156373 - Flags: review?(neil.parkwaycc.co.uk) → review+
Attachment #156373 - Flags: superreview?(bienvenu)
Attachment #156373 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 156373 [details] [diff] [review] Filter fix v5 (SM Trunk part) [Checked in: Comment 22] I guess: *it (should) applies to v1.7.x branch ! *it will then be automatically included in aviary branch ? (if needed) Mark: Do you have cvs checkin rights, or do you need Neil(!?) to do it for you ?
Attachment #156373 - Flags: approval1.7.3?
I have no check-in rights, so if someone can do that for me it'll be great. Thanks in advance.
Fix checked in to the trunk, but I can't help with branches, try bienvenu.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago21 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8alpha4
the patch doesn't cleanly apply to the aviary branch...
Attachment #156373 - Flags: approval1.7.3?
(In reply to comment #23) > the patch doesn't cleanly apply to the aviary branch... I don't know much about Aviary (could you post any hint on what is out of sync ?); then 'gautheri: approval1.7.3?' moved on "needed" patch from 233091 first...
Attachment #156373 - Attachment description: Filter fix v5 → Filter fix v5 [Checked in: Comment 22]
Attachment #156373 - Attachment description: Filter fix v5 [Checked in: Comment 22] → Filter fix v5 (SM Trunk part) [Checked in: Comment 22]
Attachment #156373 - Attachment is obsolete: true
Filter fix v5 (SM Trunk part), "back-ported" to v1.7(.3) branch.
Comment on attachment 156823 [details] [diff] [review] (Bv1) <FilterEditor.js> ++ (SM v1.7.x branch part) Keeping {{ Filter fix v5 (SM Trunk part) [Checked in: Comment 22] patch 2004-08-17 14:28 PDT neil.parkwaycc.co.uk: review+ bienvenu: superreview+ }}
Attachment #156823 - Flags: superreview+
Attachment #156823 - Flags: review+
Attachment #156823 - Flags: approval1.7.3?
Attachment #156823 - Flags: approval-aviary?
Comment on attachment 156823 [details] [diff] [review] (Bv1) <FilterEditor.js> ++ (SM v1.7.x branch part) For this to go in 1.7, it can't change a DTD file. Obviously this change doesn't have a negative impact, but I don't want the DTD file checked into 1.7 at all.
Attachment #156823 - Flags: approval1.7.3? → approval1.7.3+
(Bv1) <FilterEditor.js> ++ (SM v1.7.x branch part), without the not-mandatory .properties ("dtd") file change.
Attachment #156823 - Attachment is obsolete: true
Attachment #156823 - Flags: approval-aviary?
Comment on attachment 156841 [details] [diff] [review] (Bv1a) <FilterEditor.js> ++ (SM v1.7.x branch part) [Checked in: Comment 33] Keeping {{ (Bv1) <FilterEditor.js> ++ (SM v1.7.x branch part) patch 2004-08-23 13:06 PDT mkaply: approval1.7.3+ gautheri: review+ gautheri: superreview+ }} I think I remember that Aviary branch is synchronized with v1.7 branch "automatically", or should I request approval for explicit checkin ?
Attachment #156841 - Flags: superreview+
Attachment #156841 - Flags: review+
Attachment #156841 - Flags: approval1.7.3+
Keywords: fixed1.7.3
Comment on attachment 156841 [details] [diff] [review] (Bv1a) <FilterEditor.js> ++ (SM v1.7.x branch part) [Checked in: Comment 33] (In reply to comment #23) > the patch doesn't cleanly apply to the aviary branch... David: {{ I think I remember that Aviary branch is synchronized with v1.7 branch "automatically", or should I request approval for explicit checkin ? }} Well, asking for 'approval-aviary=?' again , on the new v1.7 patch this time: dismiss it and/or explain if this is not needed/appropriate. Thanks.
Attachment #156841 - Flags: approval-aviary?
I don't really know if they are synchronized automatically. Dbaron might be doing that, or it might have been a one time thing...
Comment on attachment 156841 [details] [diff] [review] (Bv1a) <FilterEditor.js> ++ (SM v1.7.x branch part) [Checked in: Comment 33] not relevant to aviary.
Attachment #156841 - Flags: approval-aviary? → approval-aviary-
Product: MailNews → Core
Comment on attachment 156841 [details] [diff] [review] (Bv1a) <FilterEditor.js> ++ (SM v1.7.x branch part) [Checked in: Comment 33] Check in: { 1.80.2.2 <neil@parkwaycc.co.uk> 2004-08-23 16:30 }
Attachment #156841 - Attachment description: (Bv1a) <FilterEditor.js> ++ (SM v1.7.x branch part) → (Bv1a) <FilterEditor.js> ++ (SM v1.7.x branch part) [Checked in: Comment 33]
Attachment #156841 - Attachment is obsolete: true
Attachment #156373 - Attachment is obsolete: false
Attachment #156841 - Attachment is obsolete: false
*** Bug 316214 has been marked as a duplicate of this bug. ***
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: