mirror of
https://github.com/redmine/redmine.git
synced 2025-11-09 14:56:01 +01:00
Fixed Stack level too deep error when calling #find_name_by_reflection for missing record.
git-svn-id: http://svn.redmine.org/redmine/trunk@14002 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -460,14 +460,14 @@ module IssuesHelper
|
||||
end
|
||||
@detail_value_name_by_reflection ||= Hash.new do |hash, key|
|
||||
association = Issue.reflect_on_association(key.first.to_sym)
|
||||
name = nil
|
||||
if association
|
||||
record = association.klass.find_by_id(key.last)
|
||||
if record
|
||||
record.name.force_encoding('UTF-8')
|
||||
hash[key] = record.name
|
||||
name = record.name.force_encoding('UTF-8')
|
||||
end
|
||||
end
|
||||
hash[key] ||= nil
|
||||
hash[key] = name
|
||||
end
|
||||
@detail_value_name_by_reflection[[field, id]]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user