View Issue Details

IDProjectCategoryView StatusLast Update
0031017mantisbtbugtrackerpublic2024-09-30 05:41
Reportercas Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Target Version2.27.0Fixed in Version2.27.0 
Summary0031017: Allow disabling Categories
Description

In the category table a status field is present but the field is not used, would like to use this field to have the option to (de)activate categories

Additional Information

Intention is to use this field to (de)activate categories such:

  • Deactivated categories cannot be selected when creating or editing an issue
  • For existing issues no change
  • For filtering no change
  • include option to (de)activate a category (only in Edit mode, new categories will default to Activated)

Pull request will be added

TagsNo tags attached.

Relationships

has duplicate 0012465 closeddregad Disable Categories 
related to 0032470 assignedvboctor REST API: Project Category Add/Update/Delete 
related to 0034782 resolveddregad Can't enable category General since 2.27.0 

Activities

cas

cas

2022-09-24 07:52

reporter   ~0067017

Last edited: 2024-02-11 08:29

pull request 1853 has been created to support the solution

dregad

dregad

2024-02-19 18:33

developer   ~0068570

Last edited: 2024-02-19 18:33

Commit MantisBT master e3f572c0 introduced a regression - APPLICATION ERROR 1502 (Category not found) is thrown when attempting to edit an issue without a category.

This is caused by function category_is_enabled() not checking for the special case where $p_category == 0.

Related Changesets

MantisBT: master 30d2400e

2022-09-24 07:47

cas

Committer: dregad


Details Diff
Implementing the Status field of a category

The status field in the Category table is present for quite some time
but not being used.

Categories can be deactivated, meaning that they will no longer be
available when creating or updating an issue. Existing issues will keep
their current category even if it is deactivated.

Fixes 0031017

This is the original contribution by @cas from the pull request
https://github.com/mantisbt/mantisbt/pull/1853, with all subsequent
corrective commits squashed, and commit message reformatted.

Signed-off-by: Damien Regad <dregad@mantisbt.org>
Affected Issues
0031017
mod - bug_report_page.php Diff File
mod - bug_update_page.php Diff File
mod - core/category_api.php Diff File
mod - core/constant_inc.php Diff File
mod - core/print_api.php Diff File
mod - lang/strings_english.txt Diff File
mod - manage_proj_cat_edit_page.php Diff File
mod - manage_proj_cat_update.php Diff File
mod - manage_proj_edit_page.php Diff File
mod - manage_proj_page.php Diff File

MantisBT: master 05c1639f

2024-02-11 10:20

dregad


Details Diff
Use enabled/disabled for category status

Since we currently only use a binary state (enabled/disabled) for the
status, we do not need to make things more complex than they have to be.

This simplifies @cas's original contribution by:
- using a checkbox for input instead of radio buttons
- display a check icon instead of relying on language strings in lists
- standardize on enabled/disabled terminology

This also fixes the "inverted logic" (status == 0 was previously treated
as enabled, which is the reverse of one would expect.

Fixes 0031017
Affected Issues
0031017
mod - bug_report_page.php Diff File
mod - bug_update_page.php Diff File
mod - core/category_api.php Diff File
mod - core/print_api.php Diff File
mod - lang/strings_english.txt Diff File
mod - manage_proj_cat_edit_page.php Diff File
mod - manage_proj_cat_update.php Diff File
mod - manage_proj_edit_page.php Diff File
mod - manage_proj_page.php Diff File

MantisBT: master 23c30980

2024-02-11 10:28

dregad


Details Diff
Schema update to set category.status default to 1

Fixes 0031017
Affected Issues
0031017
mod - admin/schema.php Diff File
mod - core/install_helper_functions_api.php Diff File

MantisBT: master af14961f

2024-02-11 11:50

dregad


Details Diff
Keep current disabled category when editing issue

When an issue assigned to a disabled category is edited, the category
should be kept as-is unless the user specifically updated it.

Update print_category_option_list() to add the current category, but
label it as disabled so the user knows they should change it, and set
the disabled attribute on the option so it can't be re-selected once
changed.

Fixes 0031017
Affected Issues
0031017
mod - core/print_api.php Diff File
mod - lang/strings_english.txt Diff File

MantisBT: master b8d2f120

2024-02-11 19:22

dregad


Details Diff
Fix failing CategoryTest

To maintain backwards-compatibility, category_update() signature was
modified so the new $p_status parameter is not mandatory, and defaults
to null to keep the category's existing status.

Issue 0031017
Affected Issues
0031017
mod - core/category_api.php Diff File

MantisBT: master ed41f512

2024-02-12 11:47

dregad


Details Diff
Only propose enabled categories

It should not be possible to select a disabled category

- when mass-updating issues
- as fallback when importing issues (XmlImportExport plugin)

Issue 0031017
Affected Issues
0031017
mod - bug_actiongroup_page.php Diff File
mod - plugins/XmlImportExport/pages/import.php Diff File

MantisBT: master e3f572c0

2024-02-12 11:49

dregad


Details Diff
Display warning if Issue has disabled category

Warning icon with descriptive tooltip is displayed when

- viewing an issue and allowed to edit it
- editing issue

Issue 0031017
Affected Issues
0031017
mod - bug_update_page.php Diff File
mod - bug_view_inc.php Diff File
mod - core/category_api.php Diff File
mod - lang/strings_english.txt Diff File

MantisBT: master c23ed60d

2024-02-16 12:14

dregad


Details Diff
Made category default error message more generic

Originally, the message was only about deleting a category that is set
as default for moves. This makes the message more generic, so it can
also be used in other scenarios such as update.
Made category default error message more generic

Originally, the message was only about deleting a category that is set
as default for moves. This makes the message more generic, so it can
also be used in other scenarios such as update.

The ERROR_CATEGORY_CANNOT_DELETE_DEFAULT constant was renamed to
ERROR_CATEGORY_CANNOT_UPDATE_DEFAULT to reflect the new semantics.

Issue 0031017
Affected Issues
0031017
mod - api/soap/mc_api.php Diff File
mod - core/category_api.php Diff File
mod - core/constant_inc.php Diff File
mod - lang/strings_arabic.txt Diff File
mod - lang/strings_belarusian_tarask.txt Diff File
mod - lang/strings_breton.txt Diff File
mod - lang/strings_bulgarian.txt Diff File
mod - lang/strings_catalan.txt Diff File
mod - lang/strings_chinese_simplified.txt Diff File
mod - lang/strings_chinese_traditional.txt Diff File
mod - lang/strings_czech.txt Diff File
mod - lang/strings_danish.txt Diff File
mod - lang/strings_dutch.txt Diff File
mod - lang/strings_english.txt Diff File
mod - lang/strings_french.txt Diff File
mod - lang/strings_galician.txt Diff File
mod - lang/strings_german.txt Diff File
mod - lang/strings_hebrew.txt Diff File
mod - lang/strings_hungarian.txt Diff File
mod - lang/strings_icelandic.txt Diff File
mod - lang/strings_interlingua.txt Diff File
mod - lang/strings_italian.txt Diff File
mod - lang/strings_japanese.txt Diff File
mod - lang/strings_korean.txt Diff File
mod - lang/strings_lithuanian.txt Diff File
mod - lang/strings_macedonian.txt Diff File
mod - lang/strings_norwegian_bokmal.txt Diff File
mod - lang/strings_occitan.txt Diff File
mod - lang/strings_polish.txt Diff File
mod - lang/strings_portuguese_brazil.txt Diff File
mod - lang/strings_portuguese_standard.txt Diff File
mod - lang/strings_romanian.txt Diff File
mod - lang/strings_russian.txt Diff File
mod - lang/strings_serbian.txt Diff File
mod - lang/strings_serbian_latin.txt Diff File
mod - lang/strings_slovak.txt Diff File
mod - lang/strings_spanish.txt Diff File
mod - lang/strings_swedish.txt Diff File
mod - lang/strings_swissgerman.txt Diff File
mod - lang/strings_tagalog.txt Diff File
mod - lang/strings_turkish.txt Diff File
mod - lang/strings_ukrainian.txt Diff File
mod - lang/strings_vietnamese.txt Diff File

MantisBT: master ff09c2ed

2024-02-16 12:23

dregad


Details Diff
Prevent disabling category if used as default

If the category being disabled is used as default_category_for_moves in
any project, then category_update() now fails with an error.

Issue 0031017
Affected Issues
0031017
mod - core/category_api.php Diff File

MantisBT: master fc4c9462

2024-02-16 18:43

dregad


Details Diff
SOAP: only return enabled categories

mc_project_get_categories() should not return disabled categories.

Issue 0031017
Affected Issues
0031017
mod - api/soap/mantisconnect.wsdl Diff File
mod - api/soap/mc_project_api.php Diff File

MantisBT: master 5c91053e

2024-02-16 18:47

dregad


Details Diff
REST: /projects includes category status

Issue 0031017
Affected Issues
0031017
mod - api/soap/mc_project_api.php Diff File

MantisBT: master a16fa867

2024-02-19 18:30

dregad


Details Diff
Always consider Category 0 as enabled

Fixes a regression introduced by e3f572c0f9dd8e1820d76df23281a99e07636bea.

APPLICATION ERROR 1502 (Category not found) prevents editing an issue
without a category.

Issue 0031017
Affected Issues
0031017
mod - core/category_api.php Diff File