View Issue Details

IDProjectCategoryView StatusLast Update
0011307mantisbtreportspublic2014-11-25 11:04
Reporterbob Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version1.2.0rc2 
Summary0011307: Category dropdown should show global categories as well
Description

Currently Category dropdown only shows project categories.

Global categories were added in 1.2.0.x, these need to be included as well.

Steps To Reproduce

Vanilla 1.2.0, define global categories
Go to report a bug screen.
Examine category dropdown list

TagsNo tags attached.

Activities

bob

bob

2009-12-25 13:50

reporter   ~0023983

Suggested fix:
Within /core/category_api.php for function category_get_all_rows around line 426
include project_id=0 as well, ie:

if ( $t_inherit ) {
    $t_project_ids = project_hierarchy_inheritance( $p_project_id );
    # BOB
    # $t_project_where = ' project_id IN ( ' . implode( ', ', $t_project_ids ) . ' ) ';
    $t_project_where = ' project_id IN ( ' . implode( ', ', $t_project_ids ) . ' ) or project_id = 0 ';
} else {
    # BOB
    # $t_project_where = ' project_id=' . $p_project_id . ' ';
    $t_project_where = ' project_id=' . $p_project_id . ' or project_id=0 ';
}
jreese

jreese

2009-12-26 08:32

reporter   ~0023985

This is not a bug. When upgrading projects from 1.1.x, they will continue to not inherit global categories by default; you will need to manage the project, and check the "Inherit Global Categories" box and then save the project. New projects created after upgrading to 1.2 will default to inheriting global categories. This is all to maintain existing behaviors until otherwise selected by a system/project manager.

bob

bob

2010-01-05 11:29

reporter   ~0024049

Actually the error still occurs whether the inherit global categories checkbox is checked or not checked.

bob

bob

2010-01-05 11:29

reporter   ~0024050

Reopening as there is still a bug.

bob

bob

2010-01-05 11:31

reporter  

mantis_error1.png (16,109 bytes)   
mantis_error1.png (16,109 bytes)   
bob

bob

2010-01-05 11:31

reporter  

mantis_error2.png (23,347 bytes)   
mantis_error2.png (23,347 bytes)   
bob

bob

2010-01-05 11:49

reporter   ~0024051

Better fix is in core\graph_api.php within create_category_summary function.
The specific_where only selects categories from selected projects and ignores the global categories. The global categories should be included even if they are not used. Around Line 758. Change

$query = "SELECT id, name
            FROM $t_cat_table
            WHERE $specific_where
            ORDER BY name";

to
$query = "SELECT id, name
FROM $t_cat_table
WHERE $specific_where or project_id = 0
ORDER BY name";

jreese

jreese

2010-01-06 09:12

reporter   ~0024056

Kicking this over to Paul, as he's the one that's been dealing with the graphing systems.

Issue History

Date Modified Username Field Change
2009-12-25 13:48 bob New Issue
2009-12-25 13:50 bob Note Added: 0023983
2009-12-26 08:32 jreese Note Added: 0023985
2009-12-26 08:32 jreese Status new => resolved
2009-12-26 08:32 jreese Resolution open => no change required
2009-12-26 08:32 jreese Assigned To => jreese
2010-01-05 11:29 bob Note Added: 0024049
2010-01-05 11:29 bob Note Added: 0024050
2010-01-05 11:29 bob Status resolved => feedback
2010-01-05 11:29 bob Resolution no change required => reopened
2010-01-05 11:31 bob File Added: mantis_error1.png
2010-01-05 11:31 bob File Added: mantis_error2.png
2010-01-05 11:49 bob Note Added: 0024051
2010-01-05 11:49 bob Status feedback => assigned
2010-01-06 09:12 jreese Note Added: 0024056
2010-01-06 09:12 jreese Assigned To jreese => grangeway
2010-01-06 09:12 jreese Priority high => normal
2010-01-06 09:12 jreese Status assigned => acknowledged
2010-01-06 09:12 jreese Resolution reopened => open
2014-11-07 16:48 atrol Assigned To grangeway =>
2014-11-07 16:48 atrol Category other => graphs
2014-11-25 11:04 vboctor Category graphs => reports