View Issue Details

IDProjectCategoryView StatusLast Update
0027129mantisbtfilterspublic2020-08-17 03:52
Reporterpolzin Assigned Todregad  
PriorityhighSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
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

View 2 revisions

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 04:48:46

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

Issue History

Date Modified Username Field Change
2020-08-04 17:07 polzin New Issue
2020-08-04 17:07 polzin Issue generated from: 0026990
2020-08-04 17:07 polzin Relationship added related to 0026990
2020-08-04 17:12 polzin Note Added: 0064238
2020-08-04 18:14 polzin Note Added: 0064239
2020-08-04 18:19 polzin Note Edited: 0064239 View Revisions
2020-08-05 04:39 dregad Tag Attached: patch
2020-08-05 04:40 dregad Assigned To => dregad
2020-08-05 04:40 dregad Status new => assigned
2020-08-05 04:51 dregad Fixed in Version => 2.25.0
2020-08-05 04:51 dregad Note Added: 0064240
2020-08-17 03:52 dregad Changeset attached => MantisBT master 56bbac9b
2020-08-17 03:52 dregad Status assigned => resolved
2020-08-17 03:52 dregad Resolution open => fixed
2020-08-17 03:52 dregad Target Version => 2.25.0