Project

General

Profile

Voiting issue

Added by Anton Reutov about 8 years ago

Hi,
Please, can you help me with this plugin Issue Vote Plugin

This plugin working only on redmine 2x, but not on 3x
When i want to see issue, I get the error

@Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.@

Error log

@Started GET "/redmine/issues/1" for 171.61.122.40 at 2016-02-19 13:18:58 +0300
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"1"}
  Current user: anton (id=5)
  Rendered issues/_action_menu.html.erb (1.9ms)
  Rendered plugins/redmine_vote/app/views/issues/_voting_controls.html.erb (2.0ms)
  Rendered plugins/redmine_vote/app/views/issues/_issue_voting.html.erb (2.3ms)
  Rendered issues/show.html.erb within layouts/base (13.6ms)
Completed 500 Internal Server Error in 68ms (ActiveRecord: 8.1ms)

ActionView::Template::Error (wrong number of arguments (1 for 2..3)):
    1: <% vv = @issue.votes_value %>
    2: <%= content_tag('span', vv, :class => (vv > 0? 'votes-positive': ( vv < 0 ? 'votes-negative' : ''))) %>
    3: <%= content_tag('span', " (" + @issue.votes_for.to_s + "/" + @issue.votes_count.to_s + ", " + @issue.votes_percent.round(1).to_s + "%)") %>
    4: 
    5: <% @project = @issue.project %>
    6: <%= javascript_include_tag('votes', :plugin => 'redmine_vote') %>
  lib/redmine/hook/view_listener.rb:59:in `block (2 levels) in render_on'
  lib/redmine/hook/view_listener.rb:57:in `map'
  lib/redmine/hook/view_listener.rb:57:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/issues/show.html.erb:72:in `_app_views_issues_show_html_erb__3421890699313075268_70288604791920'
  app/controllers/issues_controller.rb:118:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:115:in `show'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'@

_issue_voting.html.erb

@<tr><td><b>

<% if show_votes?(@issue) %>
  <%= l :label_votes %>:</b></td><td>

  <div id='voting_controls'>
    <%= render :partial => "issues/voting_controls", :locals => { :issue => @issue, :success => nil } %>
  </div>
 <% end %>

</td></tr>@

_voting_controls.html.erb

@<% vv = @issue.votes_value %>
<%= content_tag('span', vv, :class => (vv > 0? 'votes-positive': ( vv < 0 ? 'votes-negative' : ''))) %>
<%= content_tag('span', " (" + @issue.votes_for.to_s + "/" + @issue.votes_count.to_s + ", " + @issue.votes_percent.round(1).to_s + "%)") %>

<% @project = @issue.project %>
<%= javascript_include_tag('votes', :plugin => 'redmine_vote') %>
<%= hidden_field_tag 'vote_issue_id', @issue.id %>

<% if allowed_to_vote?(@issue, :up) or allowed_to_vote?(@issue, :down) %>
  <% if allowed_to_vote?(@issue, :up, 2) or allowed_to_vote?(@issue, :down, 2) %>
    <br><%= number_field_tag 'vote_count',  '1' %>
  <% else %>
    <%= hidden_field_tag 'vote_count', '1' %>
  <% end %>
  <% if allowed_to_vote?(@issue, :up) %>
    <%= link_to("", { :controller => 'vote', :action => 'up', :id => @issue }, :class => 'icon icon-vote-up', :method => 'post', :id => 'vote_up') %>
  <% end %>
  <% if allowed_to_vote?(@issue, :down) %>
    <%= link_to("", { :controller => 'vote', :action => 'down', :id => @issue }, :class => 'icon icon-vote-down', :method => 'post', :id => 'vote_down') %>
  <% end %>
  <% if allowed_to_vote?(@issue, :clear)  and (@issue.votes_count != 0) %>
    <%= link_to("", { :controller => 'vote', :action => 'clear', :id => @issue }, :class => 'icon icon-del', :method => 'delete', :id => 'vote_delete') %>
  <% end %>
<% end %>

<div>
  <%= content_tag('div', l(:label_votes_vote_failed), :hidden => success.nil? || success, :class => 'vote-failed', :id => 'vote-failed') %>
</div>@