View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0013935 | mantisbt | filters | public | 2012-02-21 11:01 | 2014-12-22 08:22 |
Reporter | atrol | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.9 | ||||
Target Version | 1.2.9 | Fixed in Version | 1.2.9 | ||
Summary | 0013935: Version based filtering not possible | ||||
Description | When trying to filter a version you get APPLICATION ERROR # 1601 or other strange results (depends on browser) | ||||
Steps To Reproduce |
| ||||
Tags | No tags attached. | ||||
Attached Files | 0001-Fix-13935-Version-based-filtering-not-possible.patch (1,285 bytes)
From a155e0fc659197e1c7bb8a244c45f461c4261100 Mon Sep 17 00:00:00 2001 From: Damien Regad <damien.regad@merckgroup.com> Date: Wed, 22 Feb 2012 00:48:32 +0100 Subject: [PATCH] Fix #13935: Version-based filtering not possible Commit a68398245663d25229800638b6965ffe6e7ab0d3 for bug #13096 introduced a regression in version-based filtering due to not properly dealing with selected version parameter when passed as an array. --- core/print_api.php | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/print_api.php b/core/print_api.php index f8966e1..59e6d12 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -764,9 +764,12 @@ function print_version_option_list( $p_version = '', $p_project_id = null, $p_re null ); } - # Ensure the current version (if specified) is included in the list - if( !empty( $p_version ) ) { - $versions[] = version_cache_row( version_get_id( $p_version, $c_project_id ) ); + # Ensure the selected version (if specified) is included in the list + # Note: Filter API specifies selected versions as an array + if( !is_array( $p_version ) ) { + if( !empty( $p_version ) ) { + $versions[] = version_cache_row( version_get_id( $p_version, $c_project_id ) ); + } } if( $p_leading_blank ) { -- 1.7.5.4 | ||||
related to | 0013096 | closed | dregad | Spurious Target Version Behaviour. |
related to | 0013775 | confirmed | print_version_option_list() causes error when called for all projects | |
related to | 0015721 | closed | grangeway | Functionality to consider porting to master-2.0.x |
related to | 0013937 | closed | dregad | Versions and Categories from existing filter not preselected when editing it |
related to | 0013938 | closed | dregad | Error when editing issue having version not existing in current project |
Seems to be introduced by fix of 0013096 |
|
Reminder sent to: dregad please have a look at this issue |
|
It's strange. I can't reproduce this on my dev box, but I can on this tracker:
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E) Message: Unknown runtime error So my commit is apparently causing an issue in the script's execution. I'm not sure where to go from here - I don't know much about javascript to begin with, and as I cant reproduce it locally that makes it hard to investigate directly on mantisbt.org due to the compacted javascripts. Are you able to reproduce locally? |
|
Starting from a fresh cache, the version filters seem to work correctly until you "reset filter". For the record, I just updated this tracker to latest origin/master-1.2.x, and the error is still occurring. |
|
using I am no PHP developer and after reading section "Return Values" at Seems there are some more issues around version selection which have been introduced since version 1.2.8 |
|
The following code seems to fix also the new issue mentioned at 0013935:0031282 <pre> Another approach could be to call version_cache_row with false as second parameter and check the return value At the moment I prefer to discard the commit which introduces this issues, push out 1.2.9 and target the clean solution to 1.2.10 |
|
I think I get it. The filter API (in view issues page) calls print_version_option_list() with an array of values, but the code does not properly handle that. Testing this, I noticed another flaw with the version filters: the current code (including 1.2.8) is not able to select the values from the list when updating an existing filter. In other words, assume you have a saved filter on Product Version 2; if you use that filter then click on Product Version to modify the criteria, nothing is selected (should be 2). |
|
atrol, can you please test the attached fix (as I can't reproduce the behavior locally) See also related 0013937 for the issue with preselection of versions from existing filter as described in 0013935:0031284 |
|
I created 0013938 to track the issue reported in 0013935:0031282 |
|
The patch fixes this issue (not the related 0013937 and 0013938) |
|
OK, thanks for confirming. I'll push the commit later today. I know this does not address the other 2 - I have fixes lined up for these too, which I will push also but did not want to anticipate on that to avoid conflicting patches on the same section of code in case you did not confirm the fix. Thanks for testing ! |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master 57e20055 2012-02-21 10:48 Details Diff |
Fix 0013935: Version-based filtering not possible Commit a68398245663d25229800638b6965ffe6e7ab0d3 for bug 0013096 introduced a regression in version-based filtering due to not properly dealing with selected version parameter when passed as an array. |
Affected Issues 0013096, 0013935 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master-1.2.x 84c6fe6a 2012-02-21 10:48 Details Diff |
Fix 0013935: Version-based filtering not possible Commit a68398245663d25229800638b6965ffe6e7ab0d3 for bug 0013096 introduced a regression in version-based filtering due to not properly dealing with selected version parameter when passed as an array. |
Affected Issues 0013096, 0013935 |
|
mod - core/print_api.php | Diff File |