View Issue Details

IDProjectCategoryView StatusLast Update
0006497mantisbtfilterspublic2014-12-08 00:34
Reporteramit Assigned Todaryn  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.0rc4 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0006497: Setting view_filters to ADVANCED_ONLY or SIMPLE_ONLY only takes into effect after changing a filter
Description
  1. I have a project with 345 open issues.
  2. I choose to view them all (by clicking on the "View Issues" toll bar option.
  3. I can see only the first 50 (because the default number of Issues to show per page is currently set to 50).
  4. I click on the "Show" filter and change the number of issues to view to be 500.
  5. ASA I click the "Apply Filter" button the page is refreshed but...
    Now the "Hide Status" Filter suddenly disappears and my page now include ALL issues (even the ones in the "Closed" status".
  6. ASA I choose to Reset the filter the page is refreshed again and I can see the Hide Status filter again.
TagsNo tags attached.
Attached Files
6497.patch (721 bytes)   
--- view_all_set.php.old	2009-04-09 11:41:00.000000000 +0100
+++ view_all_set.php	2009-04-09 11:38:50.000000000 +0100
@@ -518,6 +518,17 @@
 
 	$tc_setting_arr = filter_ensure_valid_filter( $t_setting_arr );
 
+	//RH@EC
+	if($f_view_type == "advanced"){
+		if($tc_setting_arr['hide_status'][0] > 0)
+		{
+			$t_statuses = MantisEnum::getValues( config_get( 'status_enum_string' ) );
+			$i_to_del = array_search($tc_setting_arr['hide_status'][0],$t_statuses);
+			$tc_setting_arr['show_status'] = $t_statuses;
+			unset($tc_setting_arr['show_status'][$i_to_del]);
+		}
+	}
+	//RH@EC end of
 	$t_settings_serialized = serialize( $tc_setting_arr );
 	$t_settings_string = $t_cookie_version . '#' . $t_settings_serialized;
 
6497.patch (721 bytes)   
patch6497_1.patch (1,072 bytes)   
--- mantisbt-diff/view_all_set.php	2009-04-03 09:03:50.000000000 +0100
+++ mantisbt/view_all_set.php	2009-04-14 14:34:37.000000000 +0100
@@ -518,6 +518,31 @@
 
 	$tc_setting_arr = filter_ensure_valid_filter( $t_setting_arr );
 
+	//RH@EC http://www.mantisbt.org/bugs/view.php?id=6497
+	if($f_view_type == "advanced"){
+		if($tc_setting_arr['hide_status'][0] > 0)
+		{
+			$t_statuses = MantisEnum::getValues( config_get( 'status_enum_string' ) );
+			foreach($t_statuses as $k=>$v){
+				if($v < $tc_setting_arr['hide_status'][0])
+					{
+						$a_chunk[$k] = $v;
+					}
+				}
+			$tc_setting_arr['show_status'] = $a_chunk;
+		}
+	}
+	if($f_view_type == "simple" and $tc_setting_arr['hide_status'][0] > 0)
+	{
+		foreach($tc_setting_arr['show_status'] as $k => $v)
+		{
+			if($tc_setting_arr['show_status'][$k] == $tc_setting_arr['hide_status'][0])
+			{
+				unset($tc_setting_arr['hide_status'][0]); 	
+			}
+		}
+	}
+	//RH@EC end of
 	$t_settings_serialized = serialize( $tc_setting_arr );
 	$t_settings_string = $t_cookie_version . '#' . $t_settings_serialized;
 
patch6497_1.patch (1,072 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0016429 closeddregad By using "Advanced Filters" as default filter in config_inc.php the field "Hide Status" is shown anyway. 
related to 0011007 closedcproensa After setting $g_view_filters = ADVANCED_ONLY in config_inc.php can still end up in simple filter mode. 

Activities

vboctor

vboctor

2007-07-08 19:42

manager   ~0014903

Lets see if this is still reproducible on 1.1.0a4 when released. I've implemented several filter related fixes. This bug tracker is also running on the code with the fixes, so if it can be validates here, then great.

daryn

daryn

2008-08-04 10:28

reporter   ~0019019

I'm going to take this since i'm working on filter api. The hide status field is not available in the advanced filter. My suggestion is to modify the advanced filter so that for the current filter the show_status field defaults to have all the status' selected except the ones in the hide status field.

rhurtik

rhurtik

2009-04-09 06:48

reporter   ~0021451

Attached fix “6497.patch” modify advanced filter as mentioned in note 19019.
It activates all fields in “Status filter” and exclude the one which was selected in “Hide status”.
Conditional statement trigger “Status filter” overriding only in the case a field in “Hide status” has been selected.

Regards
Roman

daryn

daryn

2009-04-10 17:14

reporter   ~0021469

This is still an issue in current trunk and the attached patch doesn't resolve the issue. The hide status field hides the selected status and everything above it. The patch only hides the selected status. This brings up another possible issue. If a person has multi-select on the advanced filter and one or more of the selected status' is also a hidden status...which takes precedence?

rhurtik

rhurtik

2009-04-14 09:44

reporter   ~0021518

Attached fix patch6497_1.patch hide the “hide status field” status and everything above it.
If two identical fields are selected the “show status” will be chosen while the “hide status” will be unset.

vboctor

vboctor

2009-05-20 03:04

manager   ~0021858

Daryn, do you have a fix for this? Is there a reason to consider this blocking for 1.2.x release?

daryn

daryn

2010-05-11 13:37

reporter   ~0025474

I don't believe this resolves 0011007. This simply checks the status and hide status fields and tries to reconcile any differences.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036482

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master 731eaf04

2010-05-11 13:33

daryn


Details Diff
Fix 0006497 Patch contributed by Roman Hurtik. Modified for formatting and
conflict with trunk changes.
Affected Issues
0006497
mod - view_all_set.php Diff File