clipboard_image_paste icon indicating copy to clipboard operation
clipboard_image_paste copied to clipboard

works not in Redmine 4.0.4

Open chmich opened this issue 5 years ago • 15 comments

Test in Redmine 4.0.4 (in Development)

when draging the plugin into the plugins-folder:

=> Booting Puma
=> Rails 5.2.3 application starting in development 
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
	65: from /Users/dev/projects-own/invoicing/redmine-4.0.4/bin/rails:4:in `<main>'
	64: from /Users/dev/projects-own/invoicing/redmine-4.0.4/bin/rails:4:in `require'
	63: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
	62: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
	61: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
	60: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	59: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	58: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	57: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform'
	56: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap'
	55: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in `block in perform'
	54: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:51:in `start'
	53: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
	52: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app'
	51: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in `app'
	50: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/server.rb:219:in `app'
	49: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config'
	48: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file'
	47: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string'
	46: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval'
	45: from config.ru:in `<main>'
	44: from config.ru:in `new'
	43: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
	42: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
	41: from config.ru:3:in `block in <main>'
	40: from config.ru:3:in `require'
	39: from /Users/dev/projects-own/invoicing/redmine-4.0.4/config/environment.rb:14:in `<top (required)>'
	38: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
	37: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
	36: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
	35: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
	34: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
	33: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:347:in `call'
	32: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:347:in `each'
	31: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
	30: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:415:in `each_strongly_connected_component_from'
	29: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:415:in `call'
	28: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
	27: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `each'
	26: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
	25: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
	24: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	23: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	22: from /Users/dev/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
	21: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
	20: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
	19: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
	18: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/engine.rb:613:in `block in <class:Engine>'
	17: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/engine.rb:613:in `each'
	16: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
	15: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/engine.rb:656:in `load_config_initializer'
	14: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in `instrument'
	13: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/railties-5.2.3/lib/rails/engine.rb:657:in `block in load_config_initializer'
	12: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	11: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	10: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
	 9: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	 8: from /Users/dev/projects-own/invoicing/redmine-4.0.4/config/initializers/30-redmine.rb:21:in `<top (required)>'
	 7: from /Users/dev/projects-own/invoicing/redmine-4.0.4/lib/redmine/plugin.rb:166:in `load'
	 6: from /Users/dev/projects-own/invoicing/redmine-4.0.4/lib/redmine/plugin.rb:166:in `each'
	 5: from /Users/dev/projects-own/invoicing/redmine-4.0.4/lib/redmine/plugin.rb:175:in `block in load'
	 4: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 3: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 2: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	 1: from /Users/dev/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/Users/dev/projects-own/invoicing/redmine-4.0.4/plugins/clipboard_image_paste-master/init.rb:32:in `<top (required)>': undefined method `to_prepare' for ActionDispatch::Callbacks:Class (NoMethodError)
Did you mean?  to_param

Process finished with exit code 1

chmich avatar Sep 16 '19 17:09 chmich

Hello, I can conrifrm that also current #85 did not work with Redmine 4.0.4 I changed to_prepare to to_param inside the init.rb but this also wont work. Please help.

RolandSM avatar Oct 14 '19 10:10 RolandSM

Hello, I found a partial solution. It solves this and the plugin appears but when the issue saved I got another issue.

For fixing this, you need to replace this line to init.rb:

ActionDispatch::Callbacks.to_prepare do to these:

dispatcher = Rails.version < '5.1' ? ActionDispatch::Callbacks : ActiveSupport::Reloader dispatcher.to_prepare do After this, you need to patch the attachment_patch.rb replace this line: alias_method_chain :save_attachments, :pasted_images to this: alias_method :save_attachments, :save_attachments_with_pasted_images

After these modification, the plugin works fine, but the saving don't.

Sorry, I give up at this point. (I'm not a ruby developer)

Any help would be greatly appreciated!

ghost avatar Nov 17 '19 11:11 ghost

Great. If the saving process works I will try it again. I´m also not a ruby developer and completely lost in code.

RolandSM avatar Nov 19 '19 18:11 RolandSM

You can test my version https://github.com/fraoustin/clipboard_image_paste.git

fraoustin avatar Dec 05 '19 18:12 fraoustin

better try https://github.com/thorin/redmine_image_clipboard_paste.git

fraoustin avatar Dec 06 '19 17:12 fraoustin

better try https://github.com/thorin/redmine_image_clipboard_paste.git

It's working. Thanks a lot!

ghost avatar Dec 10 '19 15:12 ghost

better try https://github.com/thorin/redmine_image_clipboard_paste.git

It's working. Thanks a lot!

Well here it is not working! Tried it in Redmine 4.0.4.stable. Installation works and drag and drop too. But not copying from clipboard.

giRobert avatar Dec 27 '19 14:12 giRobert

I use docker for run redmine, my Dockerfile

FROM redmine WORKDIR /usr/src/redmine/plugins RUN git clone https://github.com/thorin/redmine_image_clipboard_paste WORKDIR /usr/src/redmine/

and it's run: copying from clipboard a screenshot

I use chrome and firefox

fraoustin avatar Dec 27 '19 16:12 fraoustin

I tested it on two machines now with different Firefox versions AND Chrome. Windows 7 and windows 10. Clipboard copy doenst work. Only drag and drop. Can you explain me how you copy from clipboard? I tried it with an existing image by klicking "copy" and also tried it with copying directly from snipping tool. I inserted it with CTRL + V in a comment and in a ticket description.

unfortunately it didnt work.

giRobert avatar Dec 30 '19 08:12 giRobert

nothing special, just click on "print screen" of my keyboard, after click on input description of my new issue and after CRTL+V ...

fraoustin avatar Dec 30 '19 08:12 fraoustin

Do y ou have activate javascript or security in you browser?

fraoustin avatar Dec 30 '19 08:12 fraoustin

I had no special settings no... i did some more research and found that "image_paste.js" was not loaded. 404 not found. i uninstalled the plugin again, removed the "-master" folder ending in plugins folder and reinstalled it. now it works fine. maybe that was the reason? my plugin folder is now called "redmine_image_clipboard_paste". i have no clue. for sure the problem was that the js was not loaded. now its working. thanks anyway for caring!

giRobert avatar Dec 30 '19 09:12 giRobert

But I found another problem. When I edit an existing ticket comment then I can not paste any screenshot there. It pasted the screenshot insert code but i guess the reference file is not uploaded and so its not be converted into a real image.

I could imagine this is a redmine limitation because there is no file upload when editing comments right?

if thats the reason there should be a check in JS like "If file upload existing => do as it works now => ELSE => dont paste the insert code!" this way we could avoid to confuse the user. The user thinks that paste worked and he looses the screenshot if he is not double checking it. Maybe its event better to paste a message "Screenshot copy is not working here". Then its clear. you know what I mean?

giRobert avatar Dec 30 '19 09:12 giRobert

I understand: if you change a issue (not add note issue but change description) the CRTL V add "link" but not file ... it's ok ? But on my computer don't have the same bug: when CRTL-V in input note or description it's ok: add link and file. I am sorry, and it's possible to add your problem in https://github.com/thorin/redmine_image_clipboard_paste (I am not a redmine_image_clipboard_paste developper) , maybe the developper can you help

Have you checked your authorization in redmine?

fraoustin avatar Dec 30 '19 15:12 fraoustin

https://github.com/thorin/redmine_image_clipboard_paste.git

It's working on redmine 4.1.0. Thanks a lot!

CNPF avatar Jan 07 '20 12:01 CNPF