View Issue Details

IDProjectCategoryView StatusLast Update
0027129mantisbtfilterspublic2021-03-07 18:29
Reporterpolzin Assigned Todregad  
PriorityhighSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.24.1 
Target Version2.25.0Fixed in Version2.25.0 
Summary0027129: Preserving filters does not work correctly on sub-sub-projects
Description

What I done:

  • change to a sub-projects PSUBSUB of PSUB
  • view_all_bug_page
  • Change filter to F1
  • Change project to PSUB
  • Change filter to F2
  • Change project to PSUBSUB

What I expect:

  • Filter F1

What I see:

  • Filter F2

The filters of simple projects are preserved, but subprojects always start with the filter of their highest ancestor project.

Tagspatch

Relationships

related to 0026990 new Changing to a project should reset the projects default filter 

Activities

polzin

polzin

2020-08-04 17:12

reporter   ~0064238

I hope that it's not a bug in my local installation, but I resetted the code to 24.1 (except config/config_inc.php parts) and the behaviour was the same. As there aren't sub-sub projects on mantisbt.org, I could not check.

polzin

polzin

2020-08-04 18:14

reporter   ~0064239

Last edited: 2020-08-04 18:19

This was strange, but I found the bug in set_project.php:
It calls filter_db_get_project_current( $f_project_id ); but $f_project_id is SUBID;SUBSUBID for subsubprojects and (int) extracts SUBID.

So the effect was that when changing a project while on view_all_bug_page, the new project get's the filter of it's ancestor project. Quite confusing.

--- a/set_project.php
+++ b/set_project.php
@@ -90,7 +90,7 @@ if( !is_blank( $c_ref ) ) {

                # if view_all_bug_page, pass on filter
                if( strcasecmp( 'view_all_bug_page.php', $t_referrer_page ) == 0 ) {
-                       $t_source_filter_id = filter_db_get_project_current( $f_project_id );
+                       $t_source_filter_id = filter_db_get_project_current( $t_bottom );
                        $t_redirect_url = 'view_all_set.php?type=' . FILTER_ACTION_GENERALIZE;

                        if( $t_source_filter_id !== null ) {
dregad

dregad

2020-08-05 04:51

developer   ~0064240

PR https://github.com/mantisbt/mantisbt/pull/1689

Related Changesets

MantisBT: master 56bbac9b

2020-08-05 00:48

dregad


Details Diff
Preserve filters on subprojects

Filters of subprojects were not kept when switching projects, the filter
of the highest ancestor was applied instead.

Patch by @polzin

Fixes 0027129
Affected Issues
0027129
mod - set_project.php Diff File