View Issue Details

IDProjectCategoryView StatusLast Update
0026127mantisbtattachmentspublic2019-10-01 14:07
Reporteranatoly.kabakov Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status confirmedResolutionopen 
Summary0026127: when inserting data from excel, an attachment is added .png = screenshot of the data
Description

when inserting data from excel, an attachment is added .png = screenshot of the data
number of added .png = number of inserts
example of a file from which the data in the attachment was copied (summary and description of this issue copied-pasted from this file
version Mantis >= 2.22.0
possibly related to 0021797
tested in browsers: Firefox 69 and Google Chrom 76.0.3809.132

TagsNo tags attached.
Attached Files
issue.xlsx (7,859 bytes)
изображение.png (235 bytes)   
изображение.png (235 bytes)   

Relationships

related to 0021797 closedsyncguru Add support for pasting images as attachments 

Activities

anatoly.kabakov

anatoly.kabakov

2019-09-12 00:56

reporter   ~0062768

if you follow the sequence of actions:

  1. insert the same data into text editor
  2. copy data from a text editor
  3. Paste into Mantis
    then inserted as text
dregad

dregad

2019-09-12 04:35

developer   ~0062769

when inserting data from excel, an attachment is added .png = screenshot of the data

By inserting I assume you mean pasting.

In my opinion, this feature works as designed.
Could you please explain why you consider this as a problem, and what you believe should be the expected behavior ?

anatoly.kabakov

anatoly.kabakov

2019-09-12 06:18

reporter   ~0062774

The screenshots from this issue do not contain any information, they only take up space in the database (the text "when inserting data from excel, an attachment is added .png = screenshot of the data" was pasting - part of this text is on the screenshot)

Each insert of such information leads to the creation of a separate screenshot - why?
I pasting the specified excel cell into the fields: summary and description - 2 screenshots were created

if I needed to pasting the inclusion of one Excel cell 5 times in the current comment, then 5 screenshots would be attached to the comment

Is this behavior of Mantis regulated by some kind of option?

anatoly.kabakov

anatoly.kabakov

2019-09-12 06:55

reporter   ~0062775

I do not paste a screenshot, I paste text from excel - this automatically inserts a screenshot of the copied excel cell

dregad

dregad

2019-09-16 10:10

developer   ~0062813

I think the problem is due to the fact that Excel is copying data to the clipboard in multiple formats, including a bitmap which is considered as a file attachment when pasting into Mantis.

This is the result of a single copy operation of an Excel cell.

DataTransferItem {kind: "string", type: "text/plain"}
DataTransferItem {kind: "string", type: "text/html"}
DataTransferItem {kind: "string", type: "text/rtf"}
DataTransferItem {kind: "file", type: "image/png"}  <== that's your screenshot

There are probably other scenarios where clipboard contents is available both as text and bitmap. The question is to identify these scenarios on the receiving end, and decide how to handle it properly.

@syncguru, any ideas ?

syncguru

syncguru

2019-09-16 16:30

developer   ~0062827

@dregad .. interesting behavior from Excel. Your analysis is correct. We pick the last entry from the clipboard since it has the target file type and continues.
A workaround for this is to use an intermediary before pasting in Mantis. Past into a text editor (i.e. sublime) then copy that and paste into Mantis.

dregad

dregad

2019-09-17 04:07

developer   ~0062833

For the record, the same issue was reported in forums.

@syncguru

A workaround for this is to use an intermediary before pasting in Mantis. Past into a text editor (i.e. sublime) then copy that and paste into Mantis.

As far as workarounds go, I think it would be easier to just remove the unwanted pasted attachment from MantisBT before submitting the issue or bugnote.

You did not answer my earlier question...

The question is to identify these scenarios on the receiving end, and decide how to handle it properly.

I've been thinking about this some, and if there are multiple formats available in the clipboard, we should default to pasting text/plain (and ignore image files).
Alternatively, we could ask the user what they actually want to paste (text or image).

Thoughts ?

syncguru

syncguru

2019-09-30 19:36

developer   ~0062927

@dregard When you paste an image, the browser generates two entries: one for the file name and the other for the actual image so defaulting to text/plain will be equal to disabling the paste functionality altogether.

dregad

dregad

2019-10-01 04:20

developer   ~0062932

defaulting to text/plain will be equal to disabling the paste functionality altogether

@syncguru, I think you misunderstood what I was saying...

if there are multiple formats available in the clipboard, we should default to pasting text/plain (and ignore image files).

In other words, I'm suggesting to give preference to pasting text vs an image, when both are present in the clipboard. If there is only an image, it would still be pasted.

If you think this is not acceptable, then what about the proposed alternative, to ask the user what they actually want to paste ?

syncguru

syncguru

2019-10-01 14:07

developer   ~0062936

if there are multiple formats available in the clipboard, we should default to pasting text/plain (and ignore image files).

There are always multiple formats available. I have not seen a case where there was only a single entry in the clipboard.

If you think this is not acceptable, then what about the proposed alternative, to ask the user what they actually want to paste ?

I like this suggestion. The next step here is to repro locally and see what mantisbt gets from clipboard then see if we can find a good solution. Asking the user is an option.