};
$self->_do_operator_function($join_args);
+ # Allow to search only in bug description (initial comment)
+ if ($self->_params->{longdesc_initial}) {
+ $join_args->{term}
+ .= ($join_args->{term} ? " AND " : "") . "$table.bug_when = bugs.creation_ts";
+ }
+
# If the user is not part of the insiders group, they cannot see
# private comments
if (!$self->_user->is_insider) {
);
# Quicksearch-wide globals for boolean charts.
-our ($chart, $and, $or, $fulltext, $bug_status_set, $bug_product_set, $ELASTIC);
+our ($chart, $and, $or, $longdesc_initial, $fulltext, $bug_status_set,
+ $bug_product_set, $ELASTIC);
sub quicksearch {
my ($searchstring) = (@_);
unshift(@words, "-$word");
}
+ # --description and ++description disable or enable description searching
+ elsif ($word =~ /^(--|\+\+)description?$/i) {
+ $longdesc_initial = $1 eq '--' ? 0 : 1;
+ $cgi->param('longdesc_initial', $longdesc_initial);
+ }
+
# --comment and ++comment disable or enable fulltext searching
elsif ($word =~ /^(--|\+\+)comments?$/i) {
$fulltext = $1 eq '--' ? 0 : 1;
if ($firstChar eq '#') {
addChart('short_desc', 'substring', $baseWord, $negate);
+ addChart('longdesc', 'substring', $baseWord, $negate)
+ if $longdesc_initial;
addChart('content', 'matches', _matches_phrase($baseWord), $negate)
if $fulltext;
return 1;
addChart('alias', 'substring', $word, $negate);
addChart('short_desc', 'substring', $word, $negate);
addChart('status_whiteboard', 'substring', $word, $negate);
- addChart('longdesc', 'substring', $word, $negate) if $ELASTIC;
+ addChart('longdesc', 'substring', $word, $negate)
+ if $longdesc_initial || $ELASTIC;
addChart('content', 'matches', _matches_phrase($word), $negate)
if $fulltext && !$ELASTIC;
delete $match_params->{offset};
}
+ # Allow to search only in bug description (initial comment)
+ if (defined $match_params->{description}) {
+ $match_params->{longdesc} = delete $match_params->{description};
+ $match_params->{longdesc_initial} = 1;
+ }
+
$match_params = Bugzilla::Bug::map_fields($match_params);
my %options = (fields => ['bug_id']);
my @depends_on = map { $self->type('int', $_) } @{$bug->dependson};
$item{'depends_on'} = \@depends_on;
}
+ if (filter_wants $params, 'description', ['extra']) {
+ my $comment = Bugzilla::Comment->match({bug_id => $bug->id, LIMIT => 1})->[0];
+ $item{'description'}
+ = ($comment && (!$comment->is_private || Bugzilla->user->is_insider))
+ ? $comment->body : '';
+ }
if (filter_wants $params, 'dupe_of') {
$item{'dupe_of'} = $self->type('int', $bug->dup_id);
}
C<array> of C<int>s. The ids of bugs that this bug "depends on".
+=item C<description>
+
+C<string> The description (initial comment) of the bug.
+
+This is an B<extra> field returned only by specifying C<description> or
+C<_extra> in C<include_fields>.
+
=item C<dupe_of>
C<int> The bug ID of the bug that this bug is a duplicate of. If this bug
=item The C<actual_time> item was added to the C<bugs> return value
in Bugzilla B<4.4>.
-=item The C<attachments>, C<comments>, C<duplicates>, C<history>,
-C<regressed_by>, C<regressions>, C<triage_owner> and C<type> fields were added
-in Bugzilla B<6.0>.
+=item The C<attachments>, C<comments>, C<description>, C<duplicates>,
+C<history>, C<regressed_by>, C<regressions>, C<triage_owner> and C<type> fields
+were added in Bugzilla B<6.0>.
=back
You can also pass this argument with the name C<reporter>, for
backwards compatibility with older Bugzillas.
+=item C<description>
+
+C<string> The description (initial comment) of the bug.
+
=item C<id>
C<int> The numeric id of the bug.
=item Updated to allow quicksearch capability in Bugzilla B<5.0>.
+=item The C<description> field was added in Bugzilla B<6.0>.
+
=back
=back
=item C<version> (string) B<Required> - A version of the product above;
the version the bug was found in.
-=item C<description> (string) B<Defaulted> - The initial description for
-this bug. Some Bugzilla installations require this to not be blank.
+=item C<description> (string) B<Defaulted> - The description (initial comment)
+of the bug. Some Bugzilla installations require this to not be blank.
=item C<op_sys> (string) B<Defaulted> - The operating system the bug was
discovered on.
:ref:`rest_attachments` for details of the object.
comments array Each array item is a Comment object. See
:ref:`rest_comments` for details of the object.
+description string The description (initial comment) of the bug.
history array Each array item is a History object. See
:ref:`rest_history` for details of the object.
tags array Each array item is a tag name. Note that tags are
can also pass this argument with the name
``reporter``, for backwards compatibility with
older Bugzillas.
+description string The description (initial comment) of the bug.
id int The numeric ID of the bug.
last_change_time datetime Searches for bugs that were modified at this time
or later. May not be an array.
**summary** string A brief description of the bug being filed.
**version** string A version of the product above; the version the
bug was found in.
-description string (defaulted) The initial description for this bug.
- Some Bugzilla installations require this to not be
- blank.
+description string (defaulted) The description (initial comment) of the
+ bug. Some Bugzilla installations require this to not
+ be blank.
op_sys string (defaulted) The operating system the bug was
discovered on.
platform string (defaulted) What type of hardware the bug was
<td class="field_name">Comment Searching</td>
<td class="field_nickname">
Allows overriding of the comment searching preference.<br>
- "<strong>++comments</strong>" will always enable comment searching.<br>
- "<strong>--comments</strong>" will always disable searching.<br>
+ "<strong>++comments</strong>" enables full-text search (all comments, slow)<br>
+ "<strong>--comments</strong>" disables full-text search<br>
+ "<strong>++description</strong>" enables description search (initial comment only)<br>
+ "<strong>--description</strong>" disables description search<br>
</td>
</tr>
[% IF Param('usestatuswhiteboard') %]
value => default.${field_container.field.name}.0
type_selected => default.$type.0
%]
+ [% IF field_container.field.name == 'longdesc' %]
+ <label><input type="checkbox" name="longdesc_initial" value="1"
+ [%- " checked" IF default.longdesc_initial.0 == "1" %]> Description (initial comment) only</label>
+ [% END %]
</div>
[% END %]