Project

General

Profile

Projects Tree View plugin - posible bug

Added by Ivan Cenov over 12 years ago

There is a small issue with this plugin concerning Project overview page. If a project has sub-projects, they are listed at the overview page and there is a text 'Sub projects' above the list. This text is hard coded in vendor\plugins\projects_tree_view\app\views\projects\show.rhtml.

I translated it to Bulgarian (Cyrillic) language. Redmine runs well, but when entering an overview page, 'Internal error 503' occurs. It seems that Redmine does not like the Cyrillic letters at this particular place. Here is the trace:

Processing ProjectsController#show (for 192.168.20.53 at 2011-08-04 15:05:53) [GET]
  Parameters: {"action"=>"show", "id"=>"cproject", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/show

ActionView::TemplateError (compile error
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:39: syntax error, unexpected tSTRING_BEG, expecting kDO or '
{' or '('
...@output_buffer.concat "<span "; @output_buffer.concat(( open...
                              ^
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:39: syntax error, unexpected kCLASS, expecting ')'
... @output_buffer.concat " class=\"empty\">&nbsp</span></td>\n...
                              ^
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:43: syntax error, unexpected kEND, expecting ')'
;  end ; @output_buffer.concat "\n\t\t" 
      ^
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:48: syntax error, unexpected kEND, expecting ')'
;  end ; @output_buffer.concat "\n\t  <tr class=\"" 
      ^
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:52: syntax error, unexpected kEND, expecting ')'
;  end ; @output_buffer.concat "\n\t  </tbody>\n\t</table>\n  " 
      ^
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:55: syntax error, unexpected kEND, expecting ')'
;  end ; @output_buffer.concat "\n<ul>\n" 
      ^
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:127: syntax error, unexpected kENSURE, expecting ')'
D:/biz/apps/redmine_trunk/vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:129: syntax error, unexpected kEND, expecting ')') on line #
39 of vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:
36:               <% end %>
37:               <% openonclick = "onclick=\"showHide('"+project.parent_id.to_s+"','"+project.parent_id.to_s+"span')\"" %>
38:               <tr class="<%= prvclasses %>" id="<%= project.parent_id.to_s + "span" %>" >
39:                     <td class="name" style="padding-left: <%= 2*ancestors.length %>em;"><%="<span " + openonclick + " class=\"expander\">&nbsp </s
pan>"%><%= h("╧юф яЁюхъЄш") %><span <%= openonclick %> class="empty">&nbsp</span></td>
40:               </span>
41:               </tr>
42:               <% ancestors << project.parent_id %>

    vendor/plugins/projects_tree_view/app/views/projects/show.rhtml:129:in `compile!'
    app/controllers/projects_controller.rb:168:in `show'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendering D:/biz/apps/redmine_trunk/public/500.html (500 Internal Server Error)
[2011-08-04 15:05:54] ERROR Errno::ECONNABORTED: An established connection was aborted by the software in your host machine.
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpresponse.rb:324:in `write'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpresponse.rb:324:in `<<'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpresponse.rb:324:in `_write_data'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpresponse.rb:296:in `send_body_string'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpresponse.rb:187:in `send_body'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpresponse.rb:104:in `send_response'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:79:in `run'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
        d:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
        d:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/handler/webrick.rb:14:in `run'
        d:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/commands/server.rb:111
        d:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        d:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        script/server:3


Replies (1)

RE: Projects Tree View plugin - posible bug - Added by Ivan Cenov over 12 years ago

... and I found this solution (and patch):

This plugin does not have config/locales section. So I made it and put there en.yml and bg.yml (attached). Also I patched projects_tree_view\app\views\projects\show.rhtml:

<td class="name" style="padding-left: <%= 2*ancestors.length %>em;"><%="<span " + openonclick + " class=\"expander\">&nbsp </span>"%><%= h("Sub Projects") %><span <%= openonclick %> class="empty">&nbsp</span></td>
to
<td class="name" style="padding-left: <%= 2*ancestors.length %>em;"><%="<span " + openonclick + " class=\"expander\">&nbsp </span>"%><%= l(:label_subprojects_plural) %><span <%= openonclick %> class="empty">&nbsp</span></td>
Now this works.
bg.yml (116 Bytes) bg.yml label_subprojects_plural
en.yml (87 Bytes) en.yml label_subprojects_plural
    (1-1/1)