Defect #14549
closedi do not know if it is a bug
0%
Description
These days,i install the Redmine in my computer.
I have encountered a lot of problems.
One of the problems is that
in the source of the redmine,there is a function in config\environment.rb:
module ActionView
module Helpers
module TextHelper
def truncate(text, length = 30, truncate_string = "...")
if text.nil? then return end
l = length-truncate_string.chars.to_a.size
(text.chars.to_a.size > length ? text.chars.to_a[0...l].join + truncate_string : text).to_s
end
end
end
end
The function truncate is used in app\views\activities\index.html.erb and other files,the source code in
app\views\activities\index.html.erb is:
<%= format_activity_description(e.event_description) %>
and the last line function format_activity_description is defined in:
app/helpers/application_helper.rb, `format_activity_title,the source code is:
def format_activity_title(text)
h(truncate_single_line(text, :length => 100))
end
the function truncate_sigle_line is also defined in app/helpers/application_helper.rb,the source code is:
def truncate_single_line(string, *args)
truncate(string.to_s, *args).gsub(%r{[\r\n]+}m, ' ')
end
the second param of the function truncate is a type of hash
but the param is defined in the function truncate a 'number' type,
that is the issue i have found,but i do not know if it is my version of redmine.
ruby version:ruby 1.8.7
Related issues