Closed Bug 454892 Opened 16 years ago Closed 16 years ago

Improve Bugzilla::CGI::clean_search_url to remove all the normal "default" fields

Categories

(Bugzilla :: Query/Bug List, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
This patch improves clean_search_url to remove all of the "default" fields that don't need to be in there--the extra "clutter" that still remains after a URL is cleaned.

One really nice thing about this patch is that it will now be impossible to actually do an "empty" query from query.cgi (thanks to bug 15089). It will still be possible to do it by hacking around with buglist.cgi, but bots or novice users won't do it accidentally.
Attachment #338198 - Flags: review?(dkl)
Component: Bugzilla-General → Query/Bug List
Comment on attachment 338198 [details] [diff] [review]
v1

Need to also clean the email related form variables as well. For example with the clean URL I still get:

emailassigned_to1=1&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailcc2=1

So you could check for emailX value being empty and if empty remove the respective checkbox vars.

Dave
Attachment #338198 - Flags: review?(dkl) → review-
Attached patch v2Splinter Review
Nice catch! :-)
Attachment #338198 - Attachment is obsolete: true
Attachment #338423 - Flags: review?(dkl)
This still doesn't remove the "field-#-#-#" (negative numbered, different than field#-#-#) fields from the URL links, which don't use clean_query_url, they use canonicalise_query to clean out fields.

If you do a search, say the following:
https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?query_format=advanced&classification=Mercury&bug_status=NEW

The Change Columns link at the bottom has the following URL:
https://landfill.bugzilla.org/bugzilla-tip/colchange.cgi?bug_status=NEW&classification=Mercury&field-1-0-0=classification&field-1-1-0=bug_status&query_format=advanced&remaction=&type-1-0-0=anyexact&type-1-1-0=anyexact&value-1-0-0=Mercury&value-1-1-0=NEW&query_based_on=

Perhaps this is a new bug, but I see it as related.  Perhaps canonicalise_query should also call clean_search_url?  Why the two functions for the same purpose?
my mistake.  I thought you meant THIS bug would take care of that.  I'll file a new bug for this.  (Bug 455317 filed)
Comment on attachment 338423 [details] [diff] [review]
v2

Looks better and works as expected. r=dkl
Attachment #338423 - Flags: review?(dkl) → review+
Yay!

Checking in Bugzilla/CGI.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/CGI.pm,v  <--  CGI.pm
new revision: 1.41; previous revision: 1.40
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: approval+
Resolution: --- → FIXED
Blocks: 509030
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: