Defect #14549

i do not know if it is a bug

Added by qiye lu almost 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Invalid Affected version:

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

Related to Redmine - Defect #2177: redMine 500 error Closed 2008-11-13

History

#1 Updated by Etienne Massip almost 6 years ago

#2 Updated by Etienne Massip almost 6 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.

Also available in: Atom PDF