Project

General

Profile

Actions

Feature #16941

closed

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

Added by Danil Tashkinov over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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.

Environment information


Files


Related issues

Related to Redmine - Feature #5358: Share Issues Categories for sub-projectsNew2010-04-20

Actions
Related to Redmine - Defect #19517: Copy issue with new projectClosed

Actions
Actions #1

Updated by Toshi MARUYAMA over 10 years ago

  • Target version set to 2.6.0
Actions #2

Updated by Toshi MARUYAMA over 10 years ago

  • Target version deleted (2.6.0)
Actions #3

Updated by Toshi MARUYAMA over 10 years ago

"Category" is depends on project.
Category ids not same even if category names are same.
I think clearing category is expected behavior.

Actions #4

Updated by Toshi MARUYAMA over 10 years ago

  • Related to Feature #5358: Share Issues Categories for sub-projects added
Actions #5

Updated by Jean-Baptiste Barth over 10 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.

Actions #6

Updated by Go MAEDA over 9 years ago

Actions #7

Updated by Alexander Stehlik over 9 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).

Actions #9

Updated by Toshi MARUYAMA over 9 years ago

  • Status changed from Closed to New
  • Target version set to 3.2.0
Actions #10

Updated by Jean-Philippe Lang about 9 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.

Actions

Also available in: Atom PDF