Closed Bug 331925 Opened 18 years ago Closed 12 years ago

Unable to use pronouns (%user%, %reporter%, ...) in boolean charts when searching for the flag requestee or the flag setter

Categories

(Bugzilla :: Query/Bug List, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: altlist, Assigned: LpSolit)

References

()

Details

(Whiteboard: [wanted-bmo])

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

I'm unable to use the %user% pronoun when searching for a flag requestee or flag setter.  I thought this would be an easy fix, something like below.  However, I don't know how the "$1" gets set when calculating the pronoun id value.

--- Bugzilla/Search.pm	2005-12-01 17:54:39.000000000 -0800
+++ Bugzilla/Search.pm	2006-03-27 18:03:27.000000000 -0800
@@ -834,6 +834,13 @@
                                "ON $flags.requestee_id = requestees_$chartid.userid");
              $f = "requestees_$chartid.login_name";
          },
+         "^setters.login_name,(?:equals|anyexact),(%\\w+%)" => sub {
+             my $flags = "flags_$chartid";
+             push(@supptables, "LEFT JOIN flags AS $flags " .
+                               "ON bugs.bug_id = $flags.bug_id " .
+                               "AND $flags.is_active = 1");
+             $term = "$flags.setter_id = " . pronoun($1,$user);
+         },
          "^setters.login_name," => sub {
              my $flags = "flags_$chartid";
              push(@supptables, "LEFT JOIN flags AS $flags " .
   

Reproducible: Always

Steps to Reproduce:
this hit me, and it's very annoying.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: normal → enhancement
(In reply to comment #1)
> this hit me, and it's very annoying.

I'm attempting to setup a saved query for whining for the AMO team and flag_requestee goes unnoticed the most.  So... +1.
(In reply to comment #0)
> However, I don't know how the "$1" gets set when calculating the pronoun id
> value.

The $1 is the result of the regex grouping "(%\\w+%)", which would be "%blah%".
Attached patch patch - v1 (untested) (obsolete) — Splinter Review
Here's an untested port of the patch in comment #0 to current tip.
Assignee: query-and-buglist → reed
Status: NEW → ASSIGNED
Summary: Unable to use %user% when searching for flag_requestee or flag_setter → Unable to use pronouns (%user%, %reporter%, ...) in boolean charts when searching for the flag requestee or the flag setter
Whiteboard: [wanted-bmo]
Attached patch patch, v2Splinter Review
Must be applied on top of bug 574577.
Assignee: reed → LpSolit
Attachment #358987 - Attachment is obsolete: true
Attachment #580449 - Flags: review?(mkanat)
Target Milestone: --- → Bugzilla 5.0
Attachment #580449 - Flags: review?(wicked)
And before mkanat asks, yes, all xt tests pass. :) But I'm a bit disappointed that this doesn't fix some TODO tests. :( Does it mean xt tests didn't add such tests in the TODO list?
Attachment #580449 - Flags: review?(wicked)
Attachment #580449 - Flags: review?(mkanat)
Attachment #580449 - Flags: review?(dkl)
Comment on attachment 580449 [details] [diff] [review]
patch, v2

Review of attachment 580449 [details] [diff] [review]:
-----------------------------------------------------------------

Works as expected. r=dkl
Attachment #580449 - Flags: review?(dkl) → review+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Search.pm
Committed revision 8120.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
(In reply to Frédéric Buclin from comment #9)
> And before mkanat asks, yes, all xt tests pass. :) But I'm a bit
> disappointed that this doesn't fix some TODO tests. :( Does it mean xt tests
> didn't add such tests in the TODO list?

  Yeah, xt isn't testing the pronouns. It really ought to be; that would be a worthwhile xt enhancement.
Added to relnotes for 4.4.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: