Closed Bug 678959 Opened 14 years ago Closed 14 years ago

GenerateUniqueToken() fails if the table doesn't contain a userid column

Categories

(Bugzilla :: Bugzilla-General, defect)

4.0.2
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: glob, Assigned: glob)

Details

Attachments

(1 file)

Attached patch patch v1Splinter Review
GenerateUniqueToken() fails if the table doesn't contain a userid column, because it uses the following to test if a token exists: SELECT userid FROM $table WHERE $column = ? This makes it hard to use from an extension.
Attachment #553138 - Flags: review?
Comment on attachment 553138 [details] [diff] [review] patch v1 OK, there is no reason to select userid specifically besides to make sure that the token doesn't already exist in this table. So SELECT 1 does exactly the same job. r=LpSolit
Attachment #553138 - Flags: review? → review+
Let's take it for 4.2 as it may cause troubles for some extensions. For 4.0.x, developers will have to write their own GenerateUniqueToken(), which is not a big deal.
Severity: normal → minor
Status: NEW → ASSIGNED
Flags: approval4.2+
Flags: approval+
Target Milestone: --- → Bugzilla 4.2
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/4.2/ modified Bugzilla/Token.pm Committed revision 7898. Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Token.pm Committed revision 7916.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: