Feature #16941
Do not clear category on project change if category with same exists
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Issues | |||
Target version: | 3.2.0 | |||
Resolution: | Fixed |
Description
Category cleared when changing project for an issue.
Steps to reproduce:
1. There is a 'project1' with category 'some' and 'project2' with the same name category.
2. Create an issue in 'project1' and select 'some' category.
3. Open edit form for this issue.
4. Select 'project2'
Expected result:
The 'project2' has a category with the same name: 'some'. And we expect that the category will be 'some'.
Actually result:
The category field is empty.
Related issues
Associated revisions
Do not clear category on project change if category with same exists (#16941).
History
#1
Updated by Toshi MARUYAMA almost 7 years ago
- Target version set to 2.6.0
#2
Updated by Toshi MARUYAMA almost 7 years ago
- Target version deleted (
2.6.0)
#3
Updated by Toshi MARUYAMA almost 7 years ago
"Category" is depends on project.
Category ids not same even if category names are same.
I think clearing category is expected behavior.
#4
Updated by Toshi MARUYAMA almost 7 years ago
- Related to Feature #5358: Share Issues Categories for sub-projects added
#5
Updated by Jean-Baptiste Barth over 6 years ago
- Status changed from New to Closed
I confirm, there's no point in having a different behaviour in the general case I think. If you want persistent values across projects then you'd better use a custom field. If there's something lacking with custom field, tell us (maybe the ability to add a value from an issue for instance?). I close this issue for now.
#6
Updated by Go MAEDA about 6 years ago
- Related to Defect #19517: Copy issue with new project added
#7
Updated by Alexander Stehlik almost 6 years ago
I guess this is a bug because Redmine behaves inconsistently here: when you edit multiple issues and change the project, categories with the same name will be preserved - see project setter for issues:
if category
self.category = project.issue_categories.find_by_name(category.name)
end
When you edit a single issue and you change the project, the category should not be cleared but should be set to a category with the same name (if available).
#8
Updated by Alexander Stehlik almost 6 years ago
Rebased the patch to current master.
#9
Updated by Toshi MARUYAMA over 5 years ago
- Status changed from Closed to New
- Target version set to 3.2.0
#10
Updated by Jean-Philippe Lang over 5 years ago
- Tracker changed from Patch to Feature
- Subject changed from Do not clear category on project change to Do not clear category on project change if category with same exists
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
This is fixed in r14715. Slightly different fix, and test added.
Thanks for pointing this out.