aboutsummaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorTiago Mello <timello@gmail.com>2010-08-24 18:03:20 -0300
committerTiago Mello <timello@gmail.com>2010-08-24 18:03:20 -0300
commitd94865b30a92be8a3a900f8d1d8262d36044b1ca (patch)
tree529e23fb497c5100c9e63432d6ddb7dc9e24058c /extensions
parent85e75aba6a7131da9d63b1f628a27e986bb428c5 (diff)
downloadbugs-d94865b30a92be8a3a900f8d1d8262d36044b1ca.tar
bugs-d94865b30a92be8a3a900f8d1d8262d36044b1ca.tar.gz
bugs-d94865b30a92be8a3a900f8d1d8262d36044b1ca.tar.bz2
bugs-d94865b30a92be8a3a900f8d1d8262d36044b1ca.tar.xz
bugs-d94865b30a92be8a3a900f8d1d8262d36044b1ca.zip
Bug 583243: Add a new hook 'search_operator_field_override'.
r/a=mkanat
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Example/Extension.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 87061aa06..4d85d01f8 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -196,6 +196,27 @@ sub buglist_columns {
$columns->{'example'} = { 'name' => 'bugs.delta_ts' , 'title' => 'Example' };
}
+sub search_operator_field_override {
+ my ($self, $args) = @_;
+
+ my $operators = $args->{'operators'};
+
+ my $original = $operators->{component}->{_non_changed};
+ $operators->{component} = {
+ _non_changed => sub { _component_nonchanged($original, @_) }
+ };
+}
+
+sub _component_nonchanged {
+ my $original = shift;
+ my ($invocant, $args) = @_;
+
+ $invocant->$original($args);
+ # Actually, it does not change anything in the result,
+ # just an example.
+ $args->{term} = $args->{term} . " OR 1=2";
+}
+
sub bugmail_recipients {
my ($self, $args) = @_;
my $recipients = $args->{recipients};