piccio / redmine_watchers_groups

Allow groups to be added as watchers
2 stars 2 forks source link

Redmine 4 compatibility #5

Open ikalafat opened 4 years ago

ikalafat commented 4 years ago

Hi @piccio,

I'm wondering do you have any plans to update the plugin to support Redmine 4.x?

This is the error I'm getting:

root@redminenovi .../www/redmine# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateIssueWatchersGroups < ActiveRecord::Migration[4.2]
/var/www/redmine/plugins/redmine_watchers_groups/db/migrate/001_create_issue_watchers_groups.rb:1:in `<top (required)>'
/var/www/redmine/lib/redmine/plugin.rb:504:in `up'
/var/www/redmine/lib/redmine/plugin.rb:536:in `migrate_plugin'
/var/www/redmine/lib/redmine/plugin.rb:477:in `migrate'
/var/www/redmine/lib/redmine/plugin.rb:491:in `block in migrate'
/var/www/redmine/lib/redmine/plugin.rb:490:in `each'
/var/www/redmine/lib/redmine/plugin.rb:490:in `migrate'
/var/www/redmine/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/usr/local/rbenv/versions/2.3.5/bin/bundle:23:in `load'
/usr/local/rbenv/versions/2.3.5/bin/bundle:23:in `<main>'

Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateIssueWatchersGroups < ActiveRecord::Migration[4.2]
/var/www/redmine/plugins/redmine_watchers_groups/db/migrate/001_create_issue_watchers_groups.rb:1:in `<top (required)>'
/var/www/redmine/lib/redmine/plugin.rb:504:in `up'
/var/www/redmine/lib/redmine/plugin.rb:536:in `migrate_plugin'
/var/www/redmine/lib/redmine/plugin.rb:477:in `migrate'
/var/www/redmine/lib/redmine/plugin.rb:491:in `block in migrate'
/var/www/redmine/lib/redmine/plugin.rb:490:in `each'
/var/www/redmine/lib/redmine/plugin.rb:490:in `migrate'
/var/www/redmine/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/usr/local/rbenv/versions/2.3.5/bin/bundle:23:in `load'
/usr/local/rbenv/versions/2.3.5/bin/bundle:23:in `<main>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)

Thanks!

ikalafat commented 4 years ago

Quick update. I have added [4.2] to migration script which has failed and it went through.

In runtime, I'm able to see groups to add as watchers, however soon after the issue is saved, I'm getting internal server error, and this is the error that appears in logs.

Completed 500 Internal Server Error in 188ms (ActiveRecord: 19.1ms)

ActionView::Template::Error (uninitialized constant #<Class:0x000055557ad37cf8>::CSS_CLASS_BY_STATUS):
     9:
    10: <h3><%= l(:label_issue_watchers) %> (<%= watched.watcher_users.size %>)</h3>
    11:
    12: <%= watchers_list(watched) %>

I assume that were more breaking changes than just the migration script.

Unfortunately, I'm not familiar with Ruby nor with Redmine development, so I can't help much.

If you ever decide to support Redmine 4, please ping me.