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
Updated by Etienne Massip over 11 years ago
- Related to Defect #2177: redMine 500 error added
Updated by Etienne Massip over 11 years ago
- Status changed from New to Closed
- Resolution set to Invalid
There's no such truncate method in core, please check source:/branches/2.3-stable/config/environment.rb.
Guess this is some old redmine monkey patched code taken from #2177?
To make a clean install, please follow instructions at RedmineInstall and for a clean upgrade at RedmineUpgrade.
And please post in forum.