Defect #27

project summary(/projects/show/*) returns error when running as CGI

Added by Satoru KURASHIKI 563 days ago. Updated 276 days ago.

Status:Closed Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:-
Target version:-

Description

but it works fine when running with webrick(same app, same DB, same RAILS_ENV).

error log is:
--
ActionView::TemplateError (Translation value "open" with arguments [0] caused error 'too many arguments for
format string') on line #29 of app/views/projects/show.rhtml:
26: <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id =>
@project,
27: :set_filter => 1,
28: "tracker_id" => tracker.id %>:
29: <%= @open_issues_by_tracker[tracker] || 0 > <= lwr(:label_open_issues, @open_issues_by_tracker[tracker] || 0) %>
30: <%= l(:label_on) > <= @total_issues_by_tracker[tracker] || 0 %></li>
31: <% end %>
32: </ul> --
Is it caused from wrong CGI settings...?

#{RAILS_ROOT}/vendor/plugins/gloc-1.1.0/lib/gloc-internal.rb:93:in `_l'
#{RAILS_ROOT}/vendor/plugins/gloc-1.1.0/lib/gloc.rb:44:in `lwr_'
#{RAILS_ROOT}/vendor/plugins/gloc-1.1.0/lib/gloc.rb:36:in `lwr'
#{RAILS_ROOT}/app/views/projects/show.rhtml:29:in `_run_rhtml_47app47views47projects47show46rhtml'
#{RAILS_ROOT}/app/views/projects/show.rhtml:25:in `each'
#{RAILS_ROOT}/app/views/projects/show.rhtml:25:in `_run_rhtml_47app47views47projects47show46rhtml'

My environment:
redmine trunk(r388) with MySQL on FreeBSD4.1

History

2007-04-11 00:10 - Satoru KURASHIKI

I think this modification make the thing well, though I
could't identify why webrick/mongrel treats this correctly...

Index: app/views/projects/show.rhtml ================================================================= ==
--- app/views/projects/show.rhtml (revision 439)
+++ app/views/projects/show.rhtml (working copy)
@ -29,7 +29,7 @
<li><%= link_to tracker.name, :controller =>
'projects', :action => 'list_issues', :id => @project,
:set_filter
=> 1,

"tracker_id" => tracker.id %>:
- <%= @open_issues_by_tracker[tracker] || 0 > <=
lwr(:label_open_issues, @open_issues_by_tracker[tracker] ||
0) %>
+ <%= @open_issues_by_tracker[tracker] || 0 > <=
lwr(:label_open_issues) %>
<%= l(:label_on) > <=
@total_issues_by_tracker[tracker] || 0 %></li>
<% end %>
</ul>

Second tag calls 'lwr' gloc method with argument
'@open_issues_by_tracker'.
But translation messages of ':label_open_issues' have no
variables(%d) in each lang.yml.

--
Additionary, this way may be imaginable.

show.rhtml: @open_issues_by_tracker[tracker] || 0) %>
<%= lwr(:label_on, @total_issues_by_tracker[tracker] ||
0) %>

<%= lwr(:label_open_issues,

lang.yml: + label_on_plural: on %d

label_open_issues: %d open
label_open_issues_plural %d open
label_on: on %d

2008-01-09 05:05 - Satoru KURASHIKI

Though I couldn't trace down the reason after all,
I get good result in this trouble with r1048.

I'll turn down this old issue.
--
OS: FreeBSD 6.1-RELEASE-p19
Ruby: self compiled 1.8.6(p111)
Gem: 1.0.1
Rails: 2.0.2
DB: MySQL

I run 'rails test', and replace Redmine's config/boot.rb
with generated one.

Also available in: Atom PDF