Closed Bug 276840 Opened 20 years ago Closed 20 years ago

Move $::defaultqueryname out of globals.pl into Bugzilla/Constants.pm

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.19.1
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

I was thinking of moving $::defaultqueryname out of globals.pl and probably into
Bugzilla::Constants. It should be a pretty simple, easy change.

I was considering also putting it in Bugzilla::Search, but it's a constant, so
it should probably go into Constants.
Attached patch Patch against the tip (obsolete) — Splinter Review
OK, here's a patch that makes these very simple changes. The only pages that
use this var are buglist.cgi and query.cgi.
Attachment #170122 - Flags: review?(vladd)
Blocks: bz-globals
No longer blocks: 84711
Comment on attachment 170122 [details] [diff] [review]
Patch against the tip

In addition to moving this to Bugzilla/Constants.pm, this also fixes some
quoting bugs by passing to SendSQL correctly quoted values instead of unquoted
ones.
Attachment #170122 - Flags: review?(vladd) → review+
Status: NEW → ASSIGNED
Flags: approval?
Summary: Move $::defaultqueryname out of globals.pl → Move $::defaultqueryname out of globals.pl in Bugzilla/Constants.pm
Target Milestone: --- → Bugzilla 2.20
Comment on attachment 170122 [details] [diff] [review]
Patch against the tip

>@@ -391,7 +391,7 @@
> if ($userid) {
>     my @namedqueries;
>     SendSQL("SELECT name FROM namedqueries " .
>-            "WHERE userid = $userid AND name != '$::defaultqueryname' " .
>+            "WHERE userid = $userid AND name != " SqlQuote(DEFAULT_QUERY_NAME) .
>             "ORDER BY name");

  Slight bug here, though, that should be fixed on check-in. That line should
be:

+	     "WHERE userid = $userid AND name != " .
SqlQuote(DEFAULT_QUERY_NAME) .

  Note the added ".".

  I don't know how that slipped by me.
This is the version that should actually be checked-in.
Attachment #170122 - Attachment is obsolete: true
Flags: approval? → approval+
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.271; previous revision: 1.270
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.285; previous revision: 1.284
done
Checking in query.cgi;
/cvsroot/mozilla/webtools/bugzilla/query.cgi,v  <--  query.cgi
new revision: 1.136; previous revision: 1.135
done
Checking in Bugzilla/Constants.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Constants.pm,v  <--  Constants.pm
new revision: 1.15; previous revision: 1.14
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Summary: Move $::defaultqueryname out of globals.pl in Bugzilla/Constants.pm → Move $::defaultqueryname out of globals.pl into Bugzilla/Constants.pm
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: