vault icon indicating copy to clipboard operation
vault copied to clipboard

Redmine 5.0

Open lluisgener opened this issue 2 years ago • 10 comments

Hello.

Is it possible to make the plugin compatible with new redmine 5?

There seems to be a compatibility issue with the new Zeitwerk loader.

Thanks in advance.

lluisgener avatar Apr 26 '22 10:04 lluisgener

I managed to get it to work for me, but there are still issues. Search isn't working and reload isn't either. I can send you my files if you want, as I can not remember what all I changed anymore.

JanB97 avatar May 09 '22 08:05 JanB97

If you can, I would appreciate it.

Thanks.

lluisgener avatar May 12 '22 10:05 lluisgener

Our debt is growing but we will try

noshutdown-ru-user avatar May 12 '22 10:05 noshutdown-ru-user

pls append your changed or you can open PR with changes

noshutdown-ru-user avatar May 12 '22 10:05 noshutdown-ru-user

I tried making a PR, but it doesn't notice my changes but tells me that everything is different. Here are my files, as I said it is working for me, but not perfect.

Just as info, the new loader seems to require a specific structure and also specific "classes" within this structure. I just added a empty variable in that case to get rid of the error but I guess to make it rubust you would have to redo how the plugin is setup.

vault.zip

JanB97 avatar May 23 '22 12:05 JanB97

I also played a while...but it didn't work...would be great if it runs on Redmine 5!

CSCSxx avatar Jun 13 '22 13:06 CSCSxx

I made the attached vault.zip by @JanB97 work by adding this to the gemfile:

if Gem::Version.new(redmine_version_major) >= Gem::Version.new('4') gem 'protected_attributes_continued', '1.8.2' end

and replacing line 112 in keys_controller.rb for:

if @key.update(params[:vault_key])

It seems to read the previous keys, and I've been able to add, update and delete new ones. I don't know if I need to test much more.

lluisgener avatar Jun 13 '22 15:06 lluisgener

I made the attached vault.zip by @JanB97 work by adding this to the gemfile:

if Gem::Version.new(redmine_version_major) >= Gem::Version.new('4') gem 'protected_attributes_continued', '1.8.2' end

and replacing line 112 in keys_controller.rb for:

if @key.update(params[:vault_key])

It seems to read the previous keys, and I've been able to add, update and delete new ones. I don't know if I need to test much more.

Oh cool, works with the gem! However, I fear that the gem will eventually stop working - but it's a great workaround, at least for now Thanks :)

CSCSxx avatar Jun 14 '22 09:06 CSCSxx

Ok so I have tried the change by @JanB97 and the updates by @lluisgener as well but I keep getting this:

Zeitwerk::NameError: expected file /opt/redmine/plugins/vault/lib/mk_keyfiles_dir.rb to define constant MkKeyfilesDir, but didn't
/var/lib/gems/2.7.0/gems/zeitwerk-2.6.4/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded'
/var/lib/gems/2.7.0/gems/zeitwerk-2.6.4/lib/zeitwerk/kernel.rb:42:in `require'

rohitthakral avatar Nov 26 '22 09:11 rohitthakral

Ignore, I was trying to use the repository and not the zip provided by @JanB97 .

Thank you guys for your help. I will try and see if I can commit this through my repository and get back to you with a merge request.

rohitthakral avatar Nov 26 '22 10:11 rohitthakral