プロジェクト

全般

プロフィール

Vote #75239

完了

Do not clear category on project change if category with same exists

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
102
issue_org_id:
16941
author_id:
62070
assigned_to_id:
1
comments:
10
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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.

Environment information


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

Admin Redmine さんが3年以上前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョン3.2.0_102 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0