View Issue Details

IDProjectCategoryView StatusLast Update
0030812mantisbtadministrationpublic2023-10-31 16:32
Reportersandyj Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.0Fixed in Version2.26.0 
Summary0030812: "Copy Categories From" copies global categories
Description

When using the "Copy Categories From" button when editing a project, all Global (All Projects) categories as well as local categories are copied across.

Tested this with a project that has "Inherit Global Categories" checked as well as when this is unchecked. In both cases Global categories are copied.

Only Local categories should be copied across. Possibly when "Inherit Global Categories" is UNchecked you may want to include Global categories but ideally they just check the box rather than copy them from another project.

Steps To Reproduce

Edit a project
"Copy Categories From" another project.
You'll see Global categories are copied as local categories.

TagsNo tags attached.
Attached Files
image.png (168,915 bytes)   
image.png (168,915 bytes)   
image-2.png (146,769 bytes)   
image-2.png (146,769 bytes)   
image-3.png (157,604 bytes)   
image-3.png (157,604 bytes)   

Activities

dregad

dregad

2022-08-04 13:03

developer   ~0066859

Only Local categories should be copied across

I agree.

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

dregad

dregad

2022-08-05 12:44

developer   ~0066868

Following discussion with @atrol in the original PR, I just submitted an alternative approach providing more flexibility by letting the user decide whether the copy operation should be restricted to the source project's "local" categories, excluding the global ones as well as those inherited from the parent project(s) or not.

See https://github.com/mantisbt/mantisbt/pull/1840

dregad

dregad

2022-08-24 11:42

developer   ~0066942

@sandyj, testing and feedback on the proposed implementations and thoughts about which one is better, would be appreciated.

sandyj

sandyj

2022-08-24 22:11

reporter   ~0066944

@dregad I don't think it makes sense to copy global categories. To copy them across once and then want independence from the global categories, defeats the purpose of the concept of Global vs Local. If they want independence, they need to create local categories. Giving them control is a good compromise. I'd make the 'Shallow' copy the default option.

Ideally, if target project does not inherit global categories but copied project does, an idea might be to have a warning like "The project you are copying from inherits global categories, you may want to enable inheriting global categories."

dregad

dregad

2022-09-03 05:17

developer   ~0066961

I don't think it makes sense to copy global categories.

I thought the same initially, but I think @atrol made a good point (see PR discussion)

Consider the global categories as some kind of template / convenience functionality when creating new projects.
You want to copy them, remove some of them, add some new ones, but after that, you want to be independent from any global changes.

That's why I made the copy of global categories optional in the 2nd PR

atrol

atrol

2022-09-03 05:30

developer   ~0066962

Thanks @dregad for considering my point.

sandyj

sandyj

2022-09-05 22:14

reporter   ~0066973

Last edited: 2022-09-05 22:16

thanks @dregad ! The duplication is my main concern which this addresses.

Related Changesets

MantisBT: master 781cbb1e

2022-08-05 12:36

dregad


Details Diff
Allow copy of categories excluding inherited ones

Add a new checkbox next to the Copy to/from buttons on Manage Project
Page, allowing user to decide whether the copy operation should be
restricted to the source project's "local" categories, excluding the
global ones as well as those inherited from the parent project(s).

Fixes 0030812
Affected Issues
0030812
mod - lang/strings_english.txt Diff File
mod - manage_proj_cat_copy.php Diff File
mod - manage_proj_edit_page.php Diff File