MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008435mantisbtfeaturepublic2007-10-02 14:222011-10-04 03:59
Reporterjreese 
Assigned Tojreese 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version1.2.0a1Fixed in Version1.2.0a1 
Summary0008435: Implement Global and Inheriting Categories Structure
DescriptionImplement a set of features for the Mantis bugtracker that will enable a simple and logical method of reducing and reusing project categories by:
- converting categories to use a category_id key
- creating global categories shared by all projects
- creating category inheritance between parent and child projects

The overall requirements outline for this planned feature has been posted on the wiki:
http://www.mantisbt.org/wiki/doku.php/mantisbt:global_categories_requirements [^]
TagsNo tags attached.
Attached Filespatch file icon mantis-categories-2007-11-10.patch [^] (59,115 bytes) 2007-11-10 15:35 [Show Content]
patch file icon mantis-categories-2007-11-12.patch [^] (60,540 bytes) 2007-11-12 16:59 [Show Content]
patch file icon mantis-categories.2008-02-04.patch [^] (30,956 bytes) 2008-02-04 11:16 [Show Content]

- Relationships
parent of 0008771closedjreese Port 0008738: Allow bugs to have no category 
has duplicate 0006048closedjreese mantis_bug_table: 'category' field should have ID of a category 
has duplicate 0007841closedjreese Categories for subproject 
has duplicate 0006039closedgiallu global categories 
related to 0000946closedjreese Implementation of sub-categories 
related to 0003370closedjreese No category filter in "View Bugs" view, when in "All Projects" mode 
related to 0008582assigneddregad Default Category for Project / Global default Category 

-  Notes
User avatar (0016149)
jreese (reporter)
2007-11-10 15:42

I've attached a patch containing the first step in this process. The patch includes:
- Converts Mantis category system and API to use unique ID's for every category.
- Updates/upgrades existing installations to the new category schema.
- Handles legacy category history entries alongside new style entries.
- Maintains all existing category functionality as visible to users.

This patch will require you to upgrade your database to work properly. Make sure you backup data before upgrading so that you can revert when you are done testing.
User avatar (0016150)
vboctor (administrator)
2007-11-10 17:25

Partial Review:

install_category_migrate()
1. $cresult / $bresult / $t_bid / $t_pid | $t_name -> would be better to use more meaningful names.
2. Use db_query_bound() instead of db_query().
3. Consider refactoring the code so you don't have to store the list of bugs in memory. We don't want the script to run out of memory with big installation.

schema.php
1. The index name "idx_category" doesn't match the fields of the index.
2. Are we going to have a unique index on project_id + name or are we going to depend on the PHP code to enforce that? This index can also be useful when we are listing the list of categories belonging to a project in an ascending order.
3. Do we want to keep the default category for a project as a config? Or do we want to move this to the project table?
4. How about "None" vs. "Unknown"?

Configuration
1. Obsolete default_bug_category and add a new one that has "_id" in it. If we want to make the name more standard with other configs then now is the time to do it. Remember to add the obsoleted config to the obsolete.php and refer to the new one.

bug_report_page.php
- $f_category_id = gpc_get_string( 'category_id' ) -- shouldn't this be gpc_get_int()?
- is_blank ( $f_category_id ) doesn't make sense.

bug_api.php
- Use db_query_bound() instead of db_query().
- '$c_category_id' -> $c_category_id?
- category_id = db_prepare_string() -> db_prepare_int()?
- db_prepare_display(): doesn't make sense to call string_display_line() on an int.

category_api.php
- Would be nice to update the documentation as part of this change or as a follow up change.
- category_remove()/category_remove_all() -> rename $p_new_category -> $p_new_category_id.

strings_english.txt
$s_no_cateogry - N/A -> None??

stopped @ filter_api.php
User avatar (0016173)
jreese (reporter)
2007-11-12 13:05

Latest patch attached with changes suggested by Victor:

category_migrate()
 - variable names expanded
 - used db_query_bound()
 - refactored out previous refactoring's bug array leftovers

schema.php
 - Renamed index
 - Added project_id as part of primary key
 - Renamed category 0 to 'None'
 - Added category_id column to project table for default category selection.

config
 - obsoleted default_bug_category
 - later work on global categories will introduce replacement configuration

bug_report_page.php
 - Fixed gpc to correct type
 - Fixed no category check to 0

bug_api.php
 - used db_query_bound()
 - Fixed int/string mistakes
 - string_display_line() is called for all int parameters already, so ?

category_api.php
 - Changed variable names in remove/remove_all

other
 - waiting on issues with db_helper_like() (0008571) before finalizing some API routines
 - waiting on finalized categories with global/inheriting features before overhauling documentation
User avatar (0016176)
jreese (reporter)
2007-11-12 17:00

New version of today's patch uploaded with numerous fixes suggested by Paul and others. Same name, more fixes.
User avatar (0016941)
jreese (reporter)
2008-02-04 11:16

Patch mantis-categories.2008-02-04.patch attached.

I've finalized my work and completed implementation of global and inheriting categories. This is a feature-complete patch, but I would like the eyes of everyone to make sure I'm not making any dumb mistakes.

Cheers
User avatar (0017161)
jreese (reporter)
2008-02-22 16:42

Fixed in trunk 1.2.x r5032.

- Related Changesets
MantisBT: master 829889da
Timestamp: 2007-11-20 01:09:10
Author: jreese
Details ] Diff ]
First phase of bug 0008435: Implement Global and Inheriting Categories Structure.
Implemented category ID behaviors to replicate all existing functionality.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4770 [^] /?p=mantisbt.git;a=object;h=f5dc347c-c33d-0410-90a0-b07cc1902cb9
mod - bug_update_advanced_page.php Diff ] File ]
mod - bug_update_page.php Diff ] File ]
mod - core/print_api.php Diff ] File ]
mod - core/filter_api.php Diff ] File ]
mod - bug_update.php Diff ] File ]
mod - core/category_api.php Diff ] File ]
mod - manage_proj_cat_edit_page.php Diff ] File ]
mod - bug_report_page.php Diff ] File ]
mod - view_all_inc.php Diff ] File ]
mod - bug_report.php Diff ] File ]
mod - config_defaults_inc.php Diff ] File ]
mod - core/obsolete.php Diff ] File ]
mod - graphs/graph_by_category.php Diff ] File ]
mod - core/columns_api.php Diff ] File ]
add - admin/install_functions.php Diff ] File ]
mod - admin/schema.php Diff ] File ]
mod - manage_proj_cat_delete.php Diff ] File ]
mod - manage_proj_cat_add.php Diff ] File ]
mod - manage_proj_cat_update.php Diff ] File ]
mod - core/summary_api.php Diff ] File ]
mod - manage_proj_edit_page.php Diff ] File ]
mod - admin/install.php Diff ] File ]
mod - core/bug_api.php Diff ] File ]
mod - core/graph_api.php Diff ] File ]
mod - bug_view_page.php Diff ] File ]
mod - bug_view_advanced_page.php Diff ] File ]
mod - my_view_page.php Diff ] File ]
mod - core/my_view_inc.php Diff ] File ]
mod - manage_proj_cat_copy.php Diff ] File ]
mod - bug_report_advanced_page.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2007-10-02 14:22 jreese New Issue
2007-10-28 12:06 jreese Status new => assigned
2007-10-28 12:06 jreese Assigned To => jreese
2007-11-10 15:35 jreese File Added: mantis-categories-2007-11-10.patch
2007-11-10 15:42 jreese Note Added: 0016149
2007-11-10 17:25 vboctor Note Added: 0016150
2007-11-12 13:02 jreese File Added: mantis-categories-2007-11-12.patch
2007-11-12 13:05 jreese Note Added: 0016173
2007-11-12 14:30 jreese File Deleted: mantis-categories-2007-11-12.patch
2007-11-12 14:30 jreese File Added: mantis-categories-2007-11-12.patch
2007-11-12 15:09 jreese Relationship added has duplicate 0006048
2007-11-12 16:59 jreese File Deleted: mantis-categories-2007-11-12.patch
2007-11-12 16:59 jreese File Added: mantis-categories-2007-11-12.patch
2007-11-12 17:00 jreese Note Added: 0016176
2007-11-13 10:54 jreese Relationship added related to 0000946
2008-02-04 11:16 jreese File Added: mantis-categories.2008-02-04.patch
2008-02-04 11:16 jreese Note Added: 0016941
2008-02-07 22:50 jreese Relationship added parent of 0008771
2008-02-07 22:58 jreese Relationship added related to 0003370
2008-02-07 23:08 jreese Relationship added has duplicate 0007841
2008-02-22 16:42 jreese Status assigned => resolved
2008-02-22 16:42 jreese Fixed in Version => 1.2.0
2008-02-22 16:42 jreese Resolution open => fixed
2008-02-22 16:42 jreese Note Added: 0017161
2008-04-19 04:10 vboctor Status resolved => closed
2008-04-22 06:13 giallu Relationship added has duplicate 0006039
2008-10-21 11:47 Changeset attached master baee2aa3 =>
2008-11-11 08:34 jreese Changeset attached master 829889da =>
2008-11-11 08:47 jreese Changeset attached master 829889da =>
2011-10-04 03:59 dhx Relationship added related to 0008582


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.1952 seconds.
memory usage: 3,346 KB
Powered by Mantis Bugtracker