giddie / redmine_default_assign

Redmine ticket #482:Default assignment setting -- converted to a plugin and then extended.
Other
34 stars 26 forks source link

Cannot uninstall plugin #37

Closed bviktor closed 7 years ago

bviktor commented 7 years ago

I need to uninstall this plugin coz 3.4 will have this feature built-in. If I run

RAILS_ENV=production rake redmine:plugins:migrate NAME=redmine_default_assign VERSION=0

and restart Redmine, it produces an internal server error (500) when I try to open project settings for any project.

Started GET "/projects/admin/settings" for 127.0.0.1 at 2017-06-27 17:25:46 +0200
Processing by ProjectsController#settings as HTML
  Parameters: {"id"=>"admin"}
  Current user: admin (id=1)
  Rendered projects/_form.html.erb (309.4ms)
  Rendered projects/_edit.html.erb (311.0ms)
  Rendered common/_tabs.html.erb (316.8ms)
  Rendered projects/settings.html.erb within layouts/base (318.2ms)
Completed 500 Internal Server Error in 514ms (ActiveRecord: 28.4ms)

ActionView::Template::Error (undefined method `default_assignee_id' for #<Project:0x00000004d0eae0>):
    29: <% @project.custom_field_values.each do |value| %>
    30:   <p><%= custom_field_tag_with_label :project, value %></p>
    31: <% end %>
    32: <%= call_hook(:view_projects_form, :project => @project, :form => f) %>
    33: </div>
    34:
    35: <% if @project.new_record? %>
  lib/redmine/views/labelled_form_builder.rb:38:in `select'
  plugins/redmine_default_assign/lib/default_assign/hooks/default_assign_projects_hooks.rb:17:in `view_projects_form'
  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/projects/_form.html.erb:32:in `_app_views_projects__form_html_erb__448760148813818185_69344020'
  app/views/projects/_edit.html.erb:2:in `block in _app_views_projects__edit_html_erb___3807876079009894782_69277440'
  app/helpers/application_helper.rb:1051:in `labelled_form_for'
  app/views/projects/_edit.html.erb:1:in `_app_views_projects__edit_html_erb___3807876079009894782_69277440'
  app/views/common/_tabs.html.erb:17:in `block in _app_views_common__tabs_html_erb__1588369234008908177_68910580'
  app/views/common/_tabs.html.erb:16:in `each'
  app/views/common/_tabs.html.erb:16:in `_app_views_common__tabs_html_erb__1588369234008908177_68910580'
  app/helpers/application_helper.rb:325:in `render_tabs'
  app/views/projects/settings.html.erb:3:in `_app_views_projects_settings_html_erb___2420892827039704034_68821460'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Please advise.

bviktor commented 7 years ago

Okay I think I solved it with something like this (I think not all of the steps are necessary but I was lazy to find out the exact details):

cd /opt/redmine
export PATH=${PATH}:/usr/local/bin
systemctl stop thin.service
RAILS_ENV=production rake redmine:plugins:migrate NAME=redmine_default_assign VERSION=0
rm -rf /opt/redmine/plugins/redmine_default_assign
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:plugins:migrate
rake tmp:cache:clear
rake tmp:sessions:clear
systemctl start thin.service