Project

General

Profile

Actions

Defect #36887

closed

copyImageFromClipboard function failed to generate a unique file name

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

Added by Simon Hori over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Attachments
Target version:
Resolution:
Fixed
Affected version:

Description

Hello,

The function copyImageFromClipboard is NOT generating unique file name but always uploading image.png.

I've confirmed the problem in chrome 99.0.4844.74, edge 100.0.1185.29, firefox 98.0.2.

This is our environment.

Environment:
  Redmine version                4.2.5.stable
  Ruby version                   2.6.9-p207 (2021-11-24) [x86_64-linux-musl]
  Rails version                  5.2.6.3
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp

Possible reason:

According from the public/javascripts/attachments.js#L283-L291 I felt that the variable 'filename' is defined but not used. Can it be the reason of this behavior?

Thank you very much for your support.


Files


Related issues 3 (0 open — 3 closed)

Related to Redmine - Defect #36013: Paste image mixed with other DataTransferItemClosedMarius BĂLTEANUActions
Has duplicate Redmine - Defect #36911: Clipboard copy is broken after upgrade to 4.2.5 or 5.0.0 from 4.2.3ClosedActions
Copied from Redmine - Patch #36817: copyImageFromClipboard function targets the first file input of the page and may conflict with other pluginsClosedMarius BĂLTEANUActions

Updated by Simon Hori over 4 years ago Actions #1

  • Copied from Patch #36817: copyImageFromClipboard function targets the first file input of the page and may conflict with other plugins added

Updated by Simon Hori over 4 years ago Actions #2

I am sorry Marius BALTEANU. Maybe I shouldn't have copied #36817 with the target version and the assignee. Please let me know if I should create a new issue from scratch.

Updated by Marius BĂLTEANU over 4 years ago Actions #3

  • Status changed from New to Confirmed

Updated by Marius BĂLTEANU over 4 years ago Actions #4

  • File 0001-Fix-copyImageFromClipboard-function-failed-to-genera.patch added

Simon, thanks for reporting this! Can you test the attached fix?

Updated by Marius BĂLTEANU over 4 years ago Actions #5

  • File deleted (0001-Fix-copyImageFromClipboard-function-failed-to-genera.patch)

Updated by Simon Hori over 4 years ago Actions #7

Awesome!! It works, thank you so much for the quick fix.

Screenshot

Updated by Marius BĂLTEANU over 4 years ago Actions #8

  • Status changed from Confirmed to Resolved
  • Resolution set to Fixed

Updated by Marius BĂLTEANU over 4 years ago Actions #9

Fix committed, thanks!

Updated by Go MAEDA over 4 years ago Actions #10

  • Related to Defect #36911: Clipboard copy is broken after upgrade to 4.2.5 or 5.0.0 from 4.2.3 added

Updated by Go MAEDA over 4 years ago Actions #11

  • Related to deleted (Defect #36911: Clipboard copy is broken after upgrade to 4.2.5 or 5.0.0 from 4.2.3)

Updated by Go MAEDA over 4 years ago Actions #12

  • Has duplicate Defect #36911: Clipboard copy is broken after upgrade to 4.2.5 or 5.0.0 from 4.2.3 added

Updated by Go MAEDA over 4 years ago Actions #13

  • Related to Defect #36013: Paste image mixed with other DataTransferItem added

Updated by Marius BĂLTEANU over 4 years ago Actions #14

Merged to stable branches, but I will keep this open for a few days, I would like to try add a system test.

Updated by Marius BĂLTEANU over 4 years ago Actions #15

  • Status changed from Resolved to Closed

I didn't find a way to add a test for this, any help is welcome.

Actions

Also available in: PDF Atom