Vote #75239
完了Do not clear category on project change if category with same exists
0%
説明
Category cleared when changing project for an issue.
Steps to reproduce:
- There is a 'project1' with category 'some' and 'project2' with the same name category.
- Create an issue in 'project1' and select 'some' category.
- Open edit form for this issue.
- 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.
journals
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
"Category" is depends on project.
Category ids not same even if category names are same.
I think clearing category is expected behavior.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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:
<pre><code class="ruby">
if category
self.category = project.issue_categories.find_by_name(category.name)
end
</code></pre>
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).
--------------------------------------------------------------------------------
Rebased the patch to current master.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
This is fixed in r14715. Slightly different fix, and test added.
Thanks for pointing this out.
--------------------------------------------------------------------------------
related_issues
relates,New,5358,Share Issues Categories for sub-projects
relates,Closed,19517,Copy issue with new project