Patch #36817

copyImageFromClipboard function targets the first file input of the page and may conflict with other plugins

Added by Yazan Al aeddin 2 months ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Marius BALTEANU% Done:

0%

Category:Attachments
Target version:4.2.6

Description

Hello,

The function copyImageFromClipboard) targets the first file input of the page and may conflict with other plugins.
On our redmine instance we use the redmine_comments plugin (https://github.com/jbbarth/redmine_comments) that adds the ability to write private note and create a new form.
We experienced a problem as shown in the image1 and image2 ,and when we click on comment as shown in image3
We managed to fix this issue, by replace the line
`var inputEl = $('input:file.filedrop').first();`
by
`var inputEl = $(this).closest("form").find('input:file.filedrop');`

Thank you for your help

image1.png (86.5 KB) Yazan Al aeddin, 2022-03-21 16:24

image2.png (68.1 KB) Yazan Al aeddin, 2022-03-21 16:24

image3.png (60.8 KB) Yazan Al aeddin, 2022-03-21 16:24

redmine_tiny_features.png (70.1 KB) Yazan Al aeddin, 2022-04-05 09:32

issue_36817.patch Magnifier (963 Bytes) Yazan Al aeddin, 2022-04-15 11:57


Related issues

Copied to Redmine - Defect #36887: copyImageFromClipboard function failed to generate a uniq... Closed

Associated revisions

Revision 21540
Added by Marius BALTEANU about 1 month ago

Use closest form when copy image from clipboard (#36817).

Patch by Yazan Al aeddin.

Revision 21544
Added by Marius BALTEANU about 1 month ago

Merged r21540 to 5.0-stable (#36817).

Revision 21545
Added by Marius BALTEANU about 1 month ago

Merged r21540 to 4.2-stable (#36817).

History

#1 Updated by Marius BALTEANU 2 months ago

  • Assignee set to Marius BALTEANU
  • Target version set to Candidate for next minor release

#2 Updated by Marius BALTEANU 2 months ago

  • Target version changed from Candidate for next minor release to 4.2.6

#3 Updated by Simon Hori about 1 month ago

  • Copied to Defect #36887: copyImageFromClipboard function failed to generate a unique file name added

#4 Updated by Marius BALTEANU about 1 month ago

I'm trying to reproduce the issue, but the plugin doesn't work on current trunk. Can you help me reproduce?

#5 Updated by Marius BALTEANU about 1 month ago

  • Status changed from New to Needs feedback
  • Assignee changed from Marius BALTEANU to Yazan Al aeddin

#6 Updated by Yazan Al aeddin about 1 month ago

Hello
Did you install the plugin (redmine_tiny_features)?
Because the bug is fixed by overriding the method (copyImageFromClipboard).

#7 Updated by Marius BALTEANU about 1 month ago

Yazan Al aeddin wrote:

Hello
Did you install the plugin (redmine_tiny_features)?
Because the bug is fixed by overriding the method (copyImageFromClipboard).

I only tried to install https://github.com/jbbarth/redmine_comments and I saw a new role permission, but nothing else in the UI.

#8 Updated by Yazan Al aeddin about 1 month ago

Ok I'll see

#9 Updated by Yazan Al aeddin about 1 month ago

Did you make (rake redmine:plugins:migrate)?

#10 Updated by Yazan Al aeddin about 1 month ago

Hello
We propose this patch
Thank you for your help.

#11 Updated by Marius BALTEANU about 1 month ago

  • Category set to Attachments
  • Status changed from Needs feedback to Resolved
  • Resolution set to Fixed

Patch committed, thanks!

#12 Updated by Marius BALTEANU about 1 month ago

  • Status changed from Resolved to Closed
  • Assignee changed from Yazan Al aeddin to Marius BALTEANU

#13 Updated by Marius BALTEANU about 1 month ago

  • Tracker changed from Defect to Patch

Also available in: Atom PDF