Project

General

Profile

Actions

Defect #13118

open

a_issue.project.issue_custom_fields don't work always correct

Added by Thomas Kohler about 11 years ago. Updated about 11 years ago.

Status:
Reopened
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

This means "a_issue.project.issue_custom_fields" and "Project.find_by_id(a_issue.project.id).issue_custom_fields" give sometimes different results. This also affect the result of the method "available_custom_fields" in issue.rb. This is only sometimes the case - don't no why.

Especially in that case "a_issue.project.issue_custom_fields.count" give also a wrong value (count like expected, but some expected entries are nil)

A simple detection is possible with:
(Project.find_by_id(a_issue.project.id).issue_custom_fields - a_issue.project.issue_custom_fields).empty?

The same for trackers:
(Tracker.find_by_id(a_issue.tracker.id).custom_fields - a_issue.tracker.custom_fields).empty?


Files

tc_redmine_defect_13118.rb (4.18 KB) tc_redmine_defect_13118.rb to reproduce the bad case and the solution Thomas Kohler, 2013-02-11 22:17
test_helper_for_redmine_defects.rb (4.87 KB) test_helper_for_redmine_defects.rb a helper class for the tests Thomas Kohler, 2013-02-11 22:19
Actions

Also available in: Atom PDF