View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008821 | mantisbt | filters | public | 2008-01-28 17:37 | 2009-01-15 11:25 |
Reporter | skygeex | Assigned To | daryn | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
OS | Windows Vista Home | ||||
Product Version | 1.1.0 | ||||
Target Version | 1.2.0a3 | Fixed in Version | 1.2.0a3 | ||
Summary | 0008821: Filtering on tags not quite working | ||||
Description | When specifying a tag name in a filter for a search, the filter is not properly applied, and all issues still come up in the search, not just those assigned the selected tag, as expected. | ||||
Steps To Reproduce | 1) Go to View Issues Notice that issues not assigned the selected tag appear in the search results. | ||||
Additional Information | A tag filter does operate properly if you enter anything into the Search: field prior to applying the tag filter. If you then back out whetever was typed into the Search: field and apply the tag filter again, it still works. But without typing something to the Search: field, filtering on tags doesn't work right. This operates contrary to all other filter parameter settings, where a Search term is not necessary to performing a proper filtered search (i.e. filtering on Status returns search results that include only those with the selected status). | ||||
Tags | No tags attached. | ||||
Attached Files | 8821.patch (1,031 bytes)
Index: filter_api.php =================================================================== --- filter_api.php (revision 5752) +++ filter_api.php (working copy) @@ -1680,9 +1680,16 @@ # tags $c_tag_string = trim( $t_filter[FILTER_PROPERTY_TAG_STRING] ); + //RH @EC #8821 + $c_tag_select = trim( $t_filter[FILTER_PROPERTY_TAG_SELECT] ); + if(is_blank( $c_tag_string ) and !is_blank($c_tag_select)) + { + $t = tag_get($c_tag_select); $c_tag_string = $t['name']; + } + //End of RH @EC #8821 if( !is_blank( $c_tag_string ) ) { $t_tags = tag_parse_filters( $c_tag_string ); - + if( count( $t_tags ) ) { $t_tags_all = array(); @@ -1733,6 +1740,7 @@ array_push( $t_where_clauses, "$t_bug_table.id NOT IN ( SELECT bug_id FROM $t_bug_tag_table WHERE ( " . implode( ' OR ', $t_clauses ) . ') )' ); } } + } # note user id @@ -2895,6 +2903,7 @@ } PRINT $t_tag_string; echo '<input type="hidden" name="', FILTER_PROPERTY_TAG_STRING, '" value="', $t_tag_string, '" />'; + ?> </td> </tr> 8821_new.patch (1,054 bytes)
Index: filter_api.php =================================================================== --- filter_api.php (revision 5752) +++ filter_api.php (working copy) @@ -1680,9 +1680,16 @@ # tags $c_tag_string = trim( $t_filter[FILTER_PROPERTY_TAG_STRING] ); + //RH @EC #8821 + $c_tag_select = trim( $t_filter[FILTER_PROPERTY_TAG_SELECT] ); + if(is_blank( $c_tag_string ) and !is_blank($c_tag_select) and $c_tag_select != 0) + { + $t = tag_get($c_tag_select); $c_tag_string = $t['name']; + } + //End of RH @EC #8821 if( !is_blank( $c_tag_string ) ) { $t_tags = tag_parse_filters( $c_tag_string ); - + if( count( $t_tags ) ) { $t_tags_all = array(); @@ -1733,6 +1740,7 @@ array_push( $t_where_clauses, "$t_bug_table.id NOT IN ( SELECT bug_id FROM $t_bug_tag_table WHERE ( " . implode( ' OR ', $t_clauses ) . ') )' ); } } + } # note user id @@ -2895,6 +2903,7 @@ } PRINT $t_tag_string; echo '<input type="hidden" name="', FILTER_PROPERTY_TAG_STRING, '" value="', $t_tag_string, '" />'; + ?> </td> </tr> | ||||
Related issue with tag filtering in version 1.1.2 is that if more than one tag is entered for the filter, it does not limit issues to only those having all the tags in the filter. I imagine that would be the desired behavior. |
|
Daryn, can you look at this? Paul |
|
Target Version changed from 1.2.0a2 to 1.2.x. Please forgive the question, but does this indicate that a fix is being deferred to some unspecified future target? |
|
yes. 1.2.0a2 was released today and due to some other priorities I was unable to complete this fix in time. 1.2.x means it is being targeted for the next release of the 1.2 codestream which would presumably be 1.2.0a3. This is an alpha release so the issue here 'should' be fixed in time for the 1.2.0 stable release. |
|
I've tried to reproduce the error on svn revision 5752 as described in summary of this issue. The only problem I've noticed is that I have to Click on Apply Filter two times to get it work. On the second submit filter works fine and only “tagged” tickets appears in the output. |
|
You are correct. This is another functional variation of the same issue. Clicking Apply Filter the first time yields non-filtered results (more issues than only those with the selected tag), and clicking Apply Filter a second time returns satisfactory results (only issues with the selected tag). It appears possible that the contents of the Search: field is irrelevant. The summary for the issue should be refined as having to click Apply Filter twice to get Tag filtering to work. |
|
core/filter.api Line 1683. Obviously on the first submit when mantis extract the “ tag_string” from data base is the text box empty and filter doesn't work. Instead of tag string I propose evaluate the tag id from drop down menu. The id is always present in the post array so this approach should solve the problem. The attached patch fix the issue. |
|
A fix for conditional statement . Please use the 8821_new.patch . |
|
Applied patch with some formatting modifications. See revision http://git.mantisbt.org/?p=mantisbt.git;a=commitdiff;h=61a03a37c0a46fa2d56f3d1209d138f074cc7d84 |
|
Version 1.1.2 (without the patch mentioned above): This bug doesn't appear with Firefox 3.0.x, only with Internet Explorer 6. |
|
FYI: You are correct, Firefox 3.0.x does not exhibit this issue, even in Mantis 1.1.0. The issue was originally encountered in Internet Explorer 7, so the problem did exist there, as well, prior to this patch. Glad it's resolved. |
|