https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292021-10-19T02:07:54ZRedmineRedmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1043702021-10-19T02:07:54ZGo MAEDA
<ul></ul><p>Could you show the detailed steps to reproduce the issue? I tried with Chome 94.0.4606.81 (macOS) but still cannot reproduce the issue. Does it depend on which application the image data is copied from?</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1043722021-10-19T02:52:22ZAdrien Crivelli
<ul></ul><p>I use XUbuntu 20.04.3, and often take screenshot with <a class="external" href="https://github.com/flameshot-org/flameshot">https://github.com/flameshot-org/flameshot</a>. The screenshot will go directly to clipboard which is super convenient to paste into Redmine. Unfortunately some colleagues run Ubuntu 20.04 (not XFCE) with Chrome(ium?) and cannot reproduced either. I am afraid that there is something specific in my setup that trigger the issue, but I cannot figure out what it is.</p>
<p>More importantly my screenshot can be pasted fine on github.com, or in Gimp. So it is somehow related to Redmine. And clipboard from Gimp will also <strong>not</strong> work on Redmine. So we can exclude flameshot as culprit.</p>
<p>Also see the reference there: <a class="external" href="https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/kind">https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/kind</a></p>
<p>I am quite confident that my patch will have no side-effect and might help others in the same (unusual?) situation as me.</p>
<p>I could show you a screencast of the whole thing, but I don't think there is anything relevant to see except the JS error I mentioned earlier.</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1043732021-10-19T02:59:14ZAdrien Crivelli
<ul></ul><p>See here: <a class="external" href="https://i.imgur.com/jV4IiPT.mp4">https://i.imgur.com/jV4IiPT.mp4</a> (I could not upload here because it is slightly too big)</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1045572021-11-08T14:33:13ZGo MAEDA
<ul></ul><p>Adrien Crivelli, thank you for your detailed report.</p>
<p>Could you try <a class="external" href="https://github.com/redmine/redmine/pull/129/files">https://github.com/redmine/redmine/pull/129/files</a> if the patch also fixes the issue in your environment?</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1045672021-11-09T01:39:01ZAdrien Crivelli
<ul></ul><p>Yes, <a class="external" href="https://github.com/redmine/redmine/pull/129/files">https://github.com/redmine/redmine/pull/129/files</a> fixes the issue for me. Thank you for your time.</p>
<p>By the way is GitHub PR a new way to accept contributions ?</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1045682021-11-09T02:02:19ZGo MAEDA
<ul></ul><p>Adrien Crivelli wrote:</p>
<blockquote>
<p>Yes, <a class="external" href="https://github.com/redmine/redmine/pull/129/files">https://github.com/redmine/redmine/pull/129/files</a> fixes the issue for me. Thank you for your time.</p>
</blockquote>
<p>Thank you for testing the fix. I will commit one of the patches.</p>
<blockquote>
<p>By the way is GitHub PR a new way to accept contributions ?</p>
</blockquote>
<p>No, the Redmine team does not accept pull requests (see <a class="external" href="https://github.com/redmine/redmine/blob/master/.github/PULL_REQUEST_TEMPLATE.md">https://github.com/redmine/redmine/blob/master/.github/PULL_REQUEST_TEMPLATE.md</a>) but I just happened to find that pull request.</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1058052022-02-27T14:02:43ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/28875">0001-Fix-for-36013.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/28875/0001-Fix-for-36013.patch">0001-Fix-for-36013.patch</a> added</li><li><strong>Tracker</strong> changed from <i>Patch</i> to <i>Defect</i></li><li><strong>Target version</strong> set to <i>4.1.7</i></li></ul><p>Adrien, sorry for not including this ticket in the latest releases.</p>
<p>I'm not able to reproduce the issue on my local environment, but I made a patch that switches from <code>clipboardData.items</code> to <code>clipboardData.files</code> and that should fix your issue as well. Can you test it, please?</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1058222022-03-02T10:28:21ZYazan Al aeddin
<ul><li><strong>File</strong> <a href="/attachments/28884">copy_image.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/28884/copy_image.png">copy_image.png</a> added</li></ul><p>Hello<br />I tested it, it works well, because I had this problem on chromium 95.0.4638.69,<br />but there is a problem, where there are two forms in the same page,<br />this problem will not exist if we replace the line (copyImageFromClipboard)<br />var inputEl = $('input:file.filedrop').first();<br />by var inputEl = $(this).closest("form").find('input:file.filedrop');</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1058992022-03-11T11:39:11ZAdrien Crivelli
<ul></ul><p>On <a class="changeset" title="Update RuboCop to 1.26 (#35136)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/21452">r21452</a>, <strong>without</strong> patch, I am no longer able to reproduce the issue. It is likely that my brand new Chrome 99.0.4844.51 somehow fixed it.</p>
<p>So I cannot confirm for sure that the patch would fix the original issue, but I can confirm that <strong>with</strong> the patch it <strong>also</strong> works.</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1059682022-03-18T17:58:25ZMarius BĂLTEANU
<ul></ul><p>Yazan Al aeddin wrote:</p>
<blockquote>
<p>Hello<br />I tested it, it works well, because I had this problem on chromium 95.0.4638.69,<br />but there is a problem, where there are two forms in the same page,<br />this problem will not exist if we replace the line (copyImageFromClipboard)<br />var inputEl = $('input:file.filedrop').first();<br />by var inputEl = $(this).closest("form").find('input:file.filedrop');</p>
</blockquote>
<p>Can you open a new issue with the steps to reproduce the problem?</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1059692022-03-18T17:58:45ZMarius BĂLTEANU
<ul></ul><p>Adrien Crivelli wrote:</p>
<blockquote>
<p>On <a class="changeset" title="Update RuboCop to 1.26 (#35136)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/21452">r21452</a>, <strong>without</strong> patch, I am no longer able to reproduce the issue. It is likely that my brand new Chrome 99.0.4844.51 somehow fixed it.</p>
<p>So I cannot confirm for sure that the patch would fix the original issue, but I can confirm that <strong>with</strong> the patch it <strong>also</strong> works.</p>
</blockquote>
<p>Thanks Adrien! I've committed the change as a refactorization.</p> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1059702022-03-18T17:59:08ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Marius BĂLTEANU</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1060922022-03-22T06:59:03ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul> Redmine - Defect #36013: Paste image mixed with other DataTransferItemhttps://www.redmine.org/issues/36013?journal_id=1063482022-04-10T08:43:34ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/36887">Defect #36887</a>: copyImageFromClipboard function failed to generate a unique file name</i> added</li></ul>