Project

General

Profile

Actions

Patch #6985

closed

Bug in diff partial

Added by Ivan Evtuhovich almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2010-11-26
Due date:
% Done:

0%

Estimated time:

Description

When using redmine_diff_email plugin, it throws error when generated diff is big

Patch attached

I18n::ArgumentError in Repositories#show

Showing app/views/common/_diff.rhtml where line #67 raised:

Object must be a Date, DateTime or Time object. :text_diff_truncated given.
Extracted source (around line #67):

64: </div>
65: <% end -%>
66: 
67: <%= l(:text_diff_truncated) if diff.truncated? %>
Trace of template inclusion: vendor/plugins/redmine_diff_email/app/views/diff_mailer/diff_notification.text.html.rhtml

Files

Actions #1

Updated by Felix Schäfer almost 14 years ago

Is this a bug in core redmine or in the plugin? If the latter is the case, this is the wrong place to report this.

Actions #2

Updated by Ivan Evtuhovich almost 14 years ago

This is problem in redmine.

l(:text_diff_truncated) - but l() should receive Date, DateTime or Time, not Symbol. I just change l() to t()

Actions #3

Updated by Felix Schäfer almost 14 years ago

Ivan Evtuhovich wrote:

This is problem in redmine.

l(:text_diff_truncated) - but l() should receive Date, DateTime or Time, not Symbol. I just change l() to t()

Nope, redmine extends I18n to make l also accept strings, see source:/trunk/lib/redmine/i18n.rb#L7, so that's not the problem. It also runs fine in the console:

>> include Redmine::I18n
=> Object
>> l(:text_diff_truncated)
=> "... This diff was truncated because it exceeds the maximum size that can be displayed."
Actions #4

Updated by Ivan Evtuhovich almost 14 years ago

Thanx, i'll try to investigate a bit more

Actions #5

Updated by Ivan Evtuhovich almost 14 years ago

I insert this code:

<%
    p "*" * 100
    p method(:l)
%>
<%= l(:text_diff_truncated) if diff.truncated? %>

and get in server output

#<Method: ActionView::Base(ActionView::Helpers::TranslationHelper)#l>

And it use i18n-0.4.2 localize

  /home/brun/.rvm/gems/ruby-1.8.7-p302@ruby-1.8.7-p249/gems/i18n-0.4.2/lib/i18n/backend/base.rb:54:in `localize'
    /home/brun/.rvm/gems/ruby-1.8.7-p302@ruby-1.8.7-p249/gems/i18n-0.4.2/lib/i18n.rb:240:in `localize'
    app/views/common/_diff.rhtml:71:in `_run_rhtml_app47views47common47_diff46rhtml_locals_diff_diff_type_object'

I have no idea what to do

Actions #6

Updated by Jean-Philippe Lang almost 14 years ago

  • Status changed from New to Closed

This is a plugin problem. It should either include Redmine::I18n in its mailer (so that #l accepts a Symbol like in the core views) or use the ::I18n syntax.
You may want to submit your patch to the plugin author.

Actions

Also available in: Atom PDF