プロジェクト

全般

プロフィール

Vote #81886

完了

copyImageFromClipboard function failed to generate a unique file name

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Attachments_19
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
19
version_id:
177
issue_org_id:
36887
author_id:
428180
assigned_to_id:
107353
comments:
15
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Hello,

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

!clipboardimage.jpg!

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":https://github.com/redmine/redmine/blob/master/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.


journals

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

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

--------------------------------------------------------------------------------

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

Screenshot
!after-the-patch.jpg!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fix committed, thanks!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Merged to stable branches, but I will keep this open for a few days, I would like to try add a system test.
--------------------------------------------------------------------------------
I didn't find a way to add a test for this, any help is welcome.
--------------------------------------------------------------------------------


related_issues

relates,Closed,36013,Paste image mixed with other DataTransferItem
duplicates,Closed,36911,Clipboard copy is broken after upgrade to 4.2.5 or 5.0.0 from 4.2.3
copied_to,Closed,36817,copyImageFromClipboard function targets the first file input of the page and may conflict with other plugins

Admin Redmine さんが3年以上前に更新

  • カテゴリAttachments_19 にセット
  • 対象バージョン4.2.6_177 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0