agileware-jp / redmine_issue_templates

Redmine Issue Template. Pull requests, reporting issues, stars and sponsoring are always welcome!
https://www.redmine.org/plugins/redmine_issue_templates
GNU General Public License v2.0
71 stars 33 forks source link

Compatibility with Redmine 5 #30

Closed qay21 closed 1 year ago

qay21 commented 2 years ago

We are currently qualifying our various plugins in order to prepare migration toward Redmine 5.x

Is there any known limitation of this plugin with Redmine 5 ? Has anyone encountered any problem yet ?

github-actions[bot] commented 2 years ago

Thank you for contributing to Redmine Issue Templates plugin!' first issue

JDQuackers commented 2 years ago

We are currently qualifying our various plugins in order to prepare migration toward Redmine 5.x

Is there any known limitation of this plugin with Redmine 5 ? Has anyone encountered any problem yet ?

Hey there -- I'm using plugin version 1.1.0 with Redmine 5.0.0 and have had no issues. All features that I utilize for my projects are fully functional:

image

teatower commented 2 years ago

Hi, have the plugin running with Redmine 5.0.1.stable, works fine. Seems I have lost the created templates while moving from one system to another. Are the templates not stored in the redmine-DB? Does anyone can give me a hint on this? Thanks!

qay21 commented 2 years ago

Aren't they simply disabled ? We noticed that sometime after updating Redmine, some templates seems to go disabled on their own. They still appear in the Configuration tab, we simply need to check the "Enabled" box again

Anthonidas commented 2 years ago

Hi, i have the latest redmine version, but the plugin does not work anymore. Am I missing something? grafik

my templates are active grafik

DimasenBro commented 2 years ago

Hello, also plugins do not work on the new version redmine 5.0.2. I wonder what can be done in this case?

ishikawa999 commented 2 years ago

@Anthonidas @DimasenBro It seems to work fine in my environment with Redmine 5.0.2 & redmine_issue_template 1.1.0 (aea59f). Are there any error messages?

DimasenBro commented 2 years ago

@ishikawa999

Hi, thanks for responding, run the use_redmine.bat: C:\Bitnami\redmine-5.0.2-0\apps\redmine\htdocs>ruby bin/rake db:migrate_plugins NAME=redmine_issue_templates RAILS_ENV=production rake aborted! LoadError: cannot load such file -- issue_templates/issues_hook C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/plugins/redmine_issue_templates/i nit.rb:24:in <top (required)>' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/lib/redmine/plugin_loader.rb:31:i nload' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/lib/redmine/plugin_loader.rb:31:i n run_initializer' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/lib/redmine/plugin_loader.rb:108: ineach' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/lib/redmine/plugin_loader.rb:108: in block in load' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/config/environment.rb:16:in<top (required)>' Tasks: TOP => db:migrate_plugins => redmine:plugins:migrate => environment (See full trace by running task with --trace)


production.log: W, [2022-08-02T08:46:44.844269 #5440] WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.


Redmine info: Environment: Redmine version 5.0.2.stable Ruby version 2.6.10-p210 (2022-04-12) [x64-mingw32] Rails version 6.1.6 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp Redmine settings: Redmine theme Default SCM: Git 2.37.1 Filesystem
Redmine plugins: redmine_checklists 3.1.21 redmine_people 1.6.2

ishikawa999 commented 2 years ago

@DimasenBro

Thanks for sharing the error log.

I think the latest code in this repository will solve this problem (related: https://github.com/agileware-jp/redmine_issue_templates/pull/11). Please get the latest code from the master branch or 0.3-stable.

DimasenBro commented 2 years ago

@ishikawa999 Executing "rails s" produces a different type of message: C:\Bitnami\redmine-5.0.2-0\apps\redmine\htdocs>rails s ... Exiting C:/Bitnami/redmine-5.0.2-0/ruby/lib/ruby/gems/2.6.0/gems/zeitwerk-2.6.0/lib/zeit werk/kernel.rb:35:in `require': cannot load such file -- listen (LoadError)

ishikawa999 commented 2 years ago

@DimasenBro

Executing "rails s" produces a different type of message:

Could you try the following command

bundle install
bundle update
gem install listen
bundle config
DimasenBro commented 2 years ago

@ishikawa999 the error remained the same, ran all the commands, restarted the Bitnami services and the server:

bundle config: C:\Bitnami\redmine-5.0.2-0\apps\redmine\htdocs>bundle config Settings are listed in order of priority. The top value will be used. bin Set for your local app (C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/.bundle/c onfig): "bin" without Set for your local app (C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/.bundle/c onfig): [:development, :test, :sqlite]

I migrated the databases from MySQL to MariaDB, but I didn’t transfer the plugins, there was an old "redmine_issue_templates 0.2.1 plugin", and now I’m installing a new one, other plugins work well

ishikawa999 commented 2 years ago

Hmmm, I don't know the cause. If you exclude the redmine_issue_templates plugin, does it start without problems?

DimasenBro commented 2 years ago

@ishikawa999 Yes, if you exclude the name of this plugin, then everything works, but templates are important to me, since there are a lot of them, I don’t want to go back to the old version of Redmine

ishikawa999 commented 2 years ago

I'll write about something else that might be good to try.

It is difficult to provide further assistance as I am unable to reproduce the problem at my end. I'm sorry I couldn't help you.

DimasenBro commented 2 years ago

@ishikawa999 1) C:\Bitnami\redmine-5.0.2-0\apps\redmine\htdocs>bundle exec rake zeitwerk:check rake aborted! LoadError: cannot load such file -- listen C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/config/environments/development.r b:58:in block in <top (required)>' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/config/environments/development.r b:5:in<top (required)>' C:/Bitnami/redmine-5.0.2-0/apps/redmine/htdocs/config/environment.rb:16:in `<top (required)>' Tasks: TOP => zeitwerk:check => environment (See full trace by running task with --trace)

1.1)run: bundle exec rake redmine:plugins RAILS_ENV=production NO ERROR!

1.2)run bitnami: production.log: W, [2022-08-02T13:18:44.073119 #4160] WARN -- : Creating scope :system. Overwriting existing method Enumeration.system. W, [2022-08-02T13:18:44.087993 #2080] WARN -- : Creating scope :system. Overwriting existing method Enumeration.system. W, [2022-08-02T13:18:44.116792 #4160] WARN -- : Creating scope :sorted. Overwriting existing method User.sorted. W, [2022-08-02T13:18:44.140712 #2080] WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.

2)I fixed all the files, but it's no use =(

Anthonidas commented 2 years ago

@ishikawa999 Hey thanks for your help. I switched to the 0.3-stable version, but nothing changed (except some minor UI ;) )

Actually it was possible to install everything even with the standard 1.1.0 version, but it doesn't show up on my redmine. I'll explain: The installation got no errors. bundle installand bundle update work as expected. i can use the rake redmine:plugins:migrate RAILS_ENV=production command to install the plugins and it still doesn't get any errors. So at this point i browse to my redmine and see that the plugin has been successfully installed. 2022-08-03_12h57_53 I can enter the configuration, and everything seems OK to me 2022-08-03_12h58_00 There are even all my saved templates inside 2022-08-03_12h58_24 I can create new and modify existing templates 2022-08-03_12h58_42

BUT nothing shows up, when i try to create a new issue. There is just no template field i can choose from, no dropdown, nothing. And there are still no errors... neither in the console nor in the log files. 2022-08-03_12h59_39

ishikawa999 commented 2 years ago

@DimasenBro

Sorry, I can't seem to solve the cause of the problem. Maybe someone familiar with Bitnami Redmine can shed some light on this.

ishikawa999 commented 2 years ago

@Anthonidas

Is the issue_templates module for that project checked?

screenshot_2022-08-04_9_24_55
Anthonidas commented 2 years ago

@ishikawa999 Yes it is.

Now after switching version, when i try to create a new template, i get this error:

I, [2022-08-04T06:44:33.747828 #3064921]  INFO -- : [97578889-ca09-490a-bbdd-5dbde78ca524] Processing by GlobalIssueTemplatesController#new as HTML
I, [2022-08-04T06:44:33.755865 #3064921]  INFO -- : [97578889-ca09-490a-bbdd-5dbde78ca524]   Current user: parentia (id=69)
I, [2022-08-04T06:44:33.813742 #3064921]  INFO -- : [97578889-ca09-490a-bbdd-5dbde78ca524]   Rendered plugins/redmine_issue_templates/app/views/global_issue_templates/new.html.erb within layouts/base (Duration: 56.1ms | Allocations: 6962)
I, [2022-08-04T06:44:33.813869 #3064921]  INFO -- : [97578889-ca09-490a-bbdd-5dbde78ca524]   Rendered layout layouts/base.html.erb (Duration: 56.3ms | Allocations: 6990)
I, [2022-08-04T06:44:33.814215 #3064921]  INFO -- : [97578889-ca09-490a-bbdd-5dbde78ca524] Completed 500 Internal Server Error in 66ms (ActiveRecord: 2.3ms | Allocations: 8690)
F, [2022-08-04T06:44:33.815797 #3064921] FATAL -- : [97578889-ca09-490a-bbdd-5dbde78ca524]
[97578889-ca09-490a-bbdd-5dbde78ca524] ActionView::Template::Error (undefined local variable or method `checklist_enabled' for #<ActionView::Base:0x00000000041438>
Did you mean?  checked_image):
[97578889-ca09-490a-bbdd-5dbde78ca524]      9:                       html: { id: 'global_issue_template-form',
[97578889-ca09-490a-bbdd-5dbde78ca524]     10:                                   class: nil, multipart: false } do |f| %>
[97578889-ca09-490a-bbdd-5dbde78ca524]     11:
[97578889-ca09-490a-bbdd-5dbde78ca524]     12:   <%= render 'form', { f: f, checklist_enabled: checklist_enabled,
[97578889-ca09-490a-bbdd-5dbde78ca524]     13:                         trackers: trackers, projects: projects,
[97578889-ca09-490a-bbdd-5dbde78ca524]     14:                         issue_template: issue_template, apply_all_projects: apply_all_projects } %>
[97578889-ca09-490a-bbdd-5dbde78ca524]     15: <% end %>
[97578889-ca09-490a-bbdd-5dbde78ca524]
[97578889-ca09-490a-bbdd-5dbde78ca524] plugins/redmine_issue_templates/app/views/global_issue_templates/new.html.erb:12
[97578889-ca09-490a-bbdd-5dbde78ca524] app/helpers/application_helper.rb:1483:in `labelled_form_for'
[97578889-ca09-490a-bbdd-5dbde78ca524] plugins/redmine_issue_templates/app/views/global_issue_templates/new.html.erb:7
[97578889-ca09-490a-bbdd-5dbde78ca524] plugins/redmine_issue_templates/app/controllers/global_issue_templates_controller.rb:31:in `new'
[97578889-ca09-490a-bbdd-5dbde78ca524] lib/redmine/sudo_mode.rb:61:in `sudo_mode'
I, [2022-08-04T06:44:46.489950 #3064921]  INFO -- : [4132a5e1-52a1-4b67-9930-6cd551b3eb3c] Started GET "/global_issue_templates/new" for 127.0.0.1 at 2022-08-04 06:44:46 +0200
I, [2022-08-04T06:44:46.491713 #3064921]  INFO -- : [4132a5e1-52a1-4b67-9930-6cd551b3eb3c] Processing by GlobalIssueTemplatesController#new as */*
I, [2022-08-04T06:44:46.501410 #3064921]  INFO -- : [4132a5e1-52a1-4b67-9930-6cd551b3eb3c]   Current user: anonymous
ishikawa999 commented 2 years ago

@Anthonidas I think that the latest code of the master branch is better than 0.3-stable for the version of the plugin to use.

Let me ask you a few questions

Anthonidas commented 2 years ago

@ishikawa999 Thank you for your hint. I switched back to the master branch, pulled the latest modifications and there they are... my templates are back 👍

Actually to your questions: must the module really be active in roles and permissions? IMHO, the template should be active for every user that uses redmine, if I - as an admin - define the template as global or anyway active for the specific project.

Anyway here my answers:

Kostas-Papapageorgiou commented 2 years ago

Hello,

I am trying the redmine upgrade to 5.0.2 (current production: 4.2.7) and I cannot get the issue_templates plugin to work (using latest version from master: git clone https://github.com/akiko-pusu/redmine_issue_templates.git). image

I thought the plugin did not support redmine 5.x but after seeing this issue, I realised there is hope. I noticed various ruby versions in the previous comments: JDQuackers redmine: 5.0.0 ruby: 3.0.2 result: ok Anthonidas redmine: 5.0.2 ruby: 3.1.2 result: ok teatower redmine: 5.0.1 result: ok DimasenBro redmine: 5.0.2 ruby: 2.6.10 result: nok

So I tried various ruby versions. My latest effort was with ruby 3.1.2 and previously with 3.0.4 and 2.7.2. The result is always:

[root@redmine-tst redmine-5.0.2]# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
rake aborted!
LoadError: cannot load such file -- issue_templates/issues_hook
/usr/local/rvm/gems/ruby-3.1.2/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.1.2/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/opt/redmine-5.0.2/plugins/redmine_issue_templates/init.rb:24:in `<top (required)>'
. . .

Inspired by a suggestion by @ishikawa999 a few comments ago, I tried bundle exec rake zeitwerk:check and it does not look good:

[root@redmine-tst redmine-5.0.2]# bundle exec rake zeitwerk:check
rake aborted!
LoadError: cannot load such file -- listen
/usr/local/rvm/gems/ruby-3.1.2/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.1.2/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.1.2/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:332:in `block in require'
/usr/local/rvm/gems/ruby-3.1.2/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:299:in `load_dependency'
. . .

So perhaps the problem I am dealing with is related to zeitwerk not issue_templates...

Rocksau80 commented 2 years ago

I also have a problem with the plugin on Redmine 5.0.2. Installation went without errors but when accessing the page I get an error. Digging through the logs I found this: Could not spawn process for application /var/www/redmine: The application encountered the following error: expected file /var/www/redmine/plugins/redmine_issue_templates/app/models/concerns/issue_template/common.rb to define constant IssueTemplate::Common, but didn't (Zeitwerk::NameError)

ishikawa999 commented 2 years ago

@Anthonidas

Actually to your questions: must the module really be active in roles and permissions? IMHO, the template should be active for every user that uses redmine, if I - as an admin - define the template as global or anyway active for the specific project.

Yes, that setting should not be necessary, but I asked the question to make sure it is not causing problems. But apparently the permissions had nothing to do with it.

Anyway here my answers:

Thanks for the info. However, using the same version of Redmine as yours, adding the redmine_agile plugin, and accessing with Firefox, the problem does not occur. I am stumped because without being able to reproduce the problem it is difficult to resolve why it is happening.

screenshot already posted ;) (https://github.com/agileware-jp/redmine_issue_templates/issues/30#issuecomment-1203808827)

That screenshot looks like the Global Issue Templates settings page. (/global_issue_templates) Is it possible to share the issue_templates settings page for each project? (/projects/:project_name/issue_templates) I don't know if this information will lead to a solution....

ishikawa999 commented 2 years ago

@Rocksau80

I am trying the redmine upgrade to 5.0.2 (current production: 4.2.7) and I cannot get the issue_templates plugin to work (using latest version from master: git clone https://github.com/akiko-pusu/redmine_issue_templates.git).

Since the code in https://github.com/akiko-pusu/redmine_issue_templates.git is not latest, try executing git clone https://github.com/agileware-jp/redmine_issue_templates.git.

Kostas-Papapageorgiou commented 2 years ago

@ishikawa999 Thank you for the suggestion!

Since the code in https://github.com/akiko-pusu/redmine_issue_templates.git is not latest, try executing git clone https://github.com/agileware-jp/redmine_issue_templates.git.

I tried. And it worked: issue_templates 1.1.0 (from agileware-jp) on Redmine 5.0.2

image

Ruby version does not seem to make a difference. Both versions work, the original 2.7.2 and the upgraded 3.1.2.

It is so good to get help! Thanks again <3

Anthonidas commented 2 years ago

@ishikawa999 Nevermind, the templates work as expected now. I think you missunderstood my post ;) The question I asked was just for me, to understand if it really is necessary. But as I said above, everything works perfectly now. I have my templates back, they work and i can even switch between them.

For everybody else: use the master branch. This one works with Redmine 5.0.2

mateusztylec commented 2 years ago

Works with redmine 5.0.3-stable

zh commented 1 year ago

New version - 1.1.1 released. Works with Redmine-5.x.