The default bug view has changed. See this FAQ.

Create an attachment by pasting it into a text field

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Attachments & Requests
P3
enhancement
RESOLVED FIXED
15 years ago
3 years ago

People

(Reporter: dougt, Assigned: Frédéric Buclin)

Tracking

(Blocks: 2 bugs, {selenium})

2.10
Bugzilla 4.2
selenium
Dependency tree / graph
Bug Flags:
approval +
testcase +

Details

(Whiteboard: [wanted-bmo][bmo4.0-post])

Attachments

(1 attachment, 2 obsolete attachments)

28.71 KB, patch
Max Kanat-Alexander
: review+
Details | Diff | Splinter Review
(Reporter)

Description

15 years ago
It would be nice if I could just paste a patch into a text field instead of
having to create a temp file.  Any chance of doing something like this??
*** Bug 119704 has been marked as a duplicate of this bug. ***
Anything's possible.

Why do you have to create temp files?  Wouldn't the patch usually start as a
file?

On the rare occasion I have had to create a temp file (through telnet), they
never seem to work anyway.
Severity: normal → enhancement
OS: Windows 2000 → All
Priority: -- → P4
Hardware: PC → All
Target Milestone: --- → Future
(Reporter)

Comment 3

15 years ago
Well, here is what I do....

a) modify code.
b) cvs diff -u > xx
c) click on Create a New Attachment
d) find the file in the File Picker

I was just thinking that c/d could be replaced with a copy and paste.
Reassigning all of my "future" targetted bugs to indicate that I'm not presently
working on them, and someone else could feel free to work on them.
Reassigning all of my "future" targetted bugs to indicate that I'm not presently
working on them, and someone else could feel free to work on them. (sorry for
the spam if you got this twice, it didn't take right the first time)
Assignee: justdave → nobody

Updated

11 years ago
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: Future → ---

Updated

10 years ago
Assignee: nobody → attach-and-request
Component: Bugzilla-General → Attachments & Requests
Priority: P4 → P3
Summary: Patch Manager - Paste patch → Create an attachment by pasting it into a text field
(Assignee)

Updated

10 years ago
Duplicate of this bug: 232218

Comment 7

7 years ago
Instead of going through multiple steps starting with pasting clipboard into a new temporary file, I should be able to paste clipboard contents into a text/plain attachment directly through a form.

Comment 8

7 years ago
This functionality has been requested at Eclipse.  See http://bugs.eclipse.org/304229

Comment 9

7 years ago
To follow up on the Eclipse request, another major use case is for users to attach a stack trace in a simple way.  As it is now, users often paste large multithreaded stack traces directly into a bug description, which impairs the communication involved.
(Assignee)

Updated

7 years ago
Duplicate of this bug: 566069
(Assignee)

Comment 11

7 years ago
Should be pretty trivial to do now that I refactored Attachment.pm.
Assignee: attach-and-request → LpSolit
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 4.2
Whiteboard: [wanted-bmo]
(Assignee)

Comment 12

7 years ago
Created attachment 456452 [details] [diff] [review]
patch, v1

Was indeed pretty easy to implement. My patch from bug 490930 must land first (it already has r+ and a+) due to conflicts.

In a separate bug, I plan to let attachment.cgi extract URLs from plain/text files, and display them above the attachment itself, so that if you paste a URL, you still have an easy way to click on it (to reproduce the old behavior).

Note that when you paste text directly, the MIME type is automatically set to text/plain. I may relax that in a separate bug. Same for the is_patch attribute.

mkanat, could you look at pieces which are outside my ownership, especially in WS and Install/?
Attachment #456452 - Flags: review?(mkanat)
(Assignee)

Updated

7 years ago
Blocks: 367651

Comment 13

7 years ago
Comment on attachment 456452 [details] [diff] [review]
patch, v1

  Hmm, I don't fully understand why you're removing isurl as part of this patch? I'm perfectly happy to see that feature go away, but it doesn't seem like this new patch actually fully duplicates that functionality?

  In any case:

>=== modified file 'Bugzilla/Field.pm'
>--- Bugzilla/Field.pm	2010-07-05 23:40:12 +0000
>+++ Bugzilla/Field.pm	2010-07-08 14:46:46 +0000
>@@ -238,7 +238,6 @@
>      buglist => 1},
>     {name => 'content',               desc => 'Content'},
>     {name => 'attach_data.thedata',   desc => 'Attachment data'},
>-    {name => 'attachments.isurl',     desc => 'Attachment is a URL'},

  You also need to add code somewhere to delete the field from fielddefs. This field never could have been updated, right? So it will never be in bugs_activity.

>=== modified file 'Bugzilla/WebService/Bug.pm'
> C<boolean> True if the attachment is obsolete, False otherwise.
> 
>-=item C<is_url>
>-
>-C<boolean> True if the attachment is a URL instead of actual data,

  You'll also need to update History to note that this field went away in Bugzilla 4.2.

  Also, I just added add_attachment to WebServices (it's pending checkin right now) so that will have to be updated as well. It will also need a History section, because it is going in to 4.0. (And stuff will also have to be removed from Errors and WS_ERROR_CODES or whatever it's called.)

>=== modified file 'template/en/default/attachment/createformcontents.html.tmpl'
>-  <th><label for="attachurl">AttachURL</label>:</th>
>+  <th><label for="attach_text">&nbsp;</label></th>

  There's no reason to have an empty <label>.

>+    <em>Or paste the text to be added as an attachment (instead of attaching a file).</em><br>
>+    <textarea id="attach_text" name="attach_text" cols="60" rows="10"
>+              onkeyup="URLFieldHandler()" onblur="URLFieldHandler()"></textarea>

  I think that it would be a really good idea to hide this field by default, and only show it if somebody clicks on a link. (And then you could hide the data field when the attach_text field was shown.)
Attachment #456452 - Flags: review?(mkanat) → review-

Comment 14

7 years ago
I think this is a great idea and probably one I'd use a lot personally. Some smarts might be if the only text pasted in matches the URL Regex then it assumes it is a URL? or does that have security implications, or maybe it's just dumb period...

I do agree with Mkanat that it would be nice to hide the big text box behind a hyperlink of sorts but not 100% necessary. Using TUI might be a good idea here as well. I find that the fewer form widgets in view the less complicated/scary the page appears. Especially when those fields are redundant and don't work in tandem.
(Assignee)

Comment 15

7 years ago
(In reply to comment #13)
>   Hmm, I don't fully understand why you're removing isurl as part of this
> patch? I'm perfectly happy to see that feature go away, but it doesn't seem
> like this new patch actually fully duplicates that functionality?

As pyrzak said, I'm going to add a regexp (in a separate bug), and if it matches, then Bugzilla will linkify the URL, restoring the behavior of isurl.

Comment 16

7 years ago
  Okay. That sounds fine. :-) Or actually, why not just run the text through quoteUrls?
(Assignee)

Comment 17

7 years ago
Because we display the file as is (coming from the alternate attachment server), not an altered one, in Details.
(Assignee)

Comment 18

7 years ago
Created attachment 457682 [details] [diff] [review]
patch, v2

I fixed everything you commented on.
Attachment #456452 - Attachment is obsolete: true
Attachment #457682 - Flags: review?(mkanat)

Comment 19

7 years ago
(In reply to comment #17)
> Because we display the file as is (coming from the alternate attachment
> server), not an altered one, in Details.

  Ah, okay. Well, maybe there could be a &quoteUrls=1 option or something, but that would be another bug for sure.

Comment 20

7 years ago
Comment on attachment 457682 [details] [diff] [review]
patch, v2

This looks great, and is really cool! :-) On checkin, I'd like it if you could change the "text_field" class to something more specific, like "attach_text", because TUI classes are global across all of Bugzilla.

Also, it might be nice to take the "or paste text as attachment" text and make it non-italic, so that it's more noticeable. But that's something we can fix later or pyrzak can make some decision about if he wants to.
Attachment #457682 - Flags: review?(mkanat) → review+

Updated

7 years ago
Flags: approval+
Keywords: relnote
(Assignee)

Comment 21

7 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified attachment.cgi
modified bugzilla.dtd
modified post_bug.cgi
modified Bugzilla/Attachment.pm
modified Bugzilla/Field.pm
modified Bugzilla/Config/Attachment.pm
modified Bugzilla/DB/Schema.pm
modified Bugzilla/Install/DB.pm
modified Bugzilla/WebService/Bug.pm
modified Bugzilla/WebService/Constants.pm
modified docs/en/xml/using.xml
modified js/attachment.js
modified template/en/default/admin/params/attachment.html.tmpl
modified template/en/default/attachment/create.html.tmpl
modified template/en/default/attachment/createformcontents.html.tmpl
modified template/en/default/attachment/edit.html.tmpl
modified template/en/default/attachment/list.html.tmpl
modified template/en/default/bug/show.xml.tmpl
modified template/en/default/bug/create/create.html.tmpl
modified template/en/default/global/code-error.html.tmpl
modified template/en/default/global/field-descs.none.tmpl
modified template/en/default/global/user-error.html.tmpl
modified xt/lib/Bugzilla/Test/Search/Constants.pm
Committed revision 7383.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Assignee)

Updated

7 years ago
Blocks: 579749
(Assignee)

Updated

7 years ago
Blocks: 584110
(Assignee)

Updated

7 years ago
Duplicate of this bug: 606979
(Assignee)

Updated

7 years ago
Blocks: 608179
(Assignee)

Updated

7 years ago
Blocks: 600516
(Assignee)

Updated

6 years ago
Duplicate of this bug: 635034
jhammel. I am going to work on backporting this to bmo/4.0 so we can have it sooner than 4.2.

Dave

Comment 25

6 years ago
(In reply to comment #24)
> jhammel. I am going to work on backporting this to bmo/4.0 so we can have it
> sooner than 4.2.

  For what it's worth, I wouldn't recommend backporting much of anything from 4.2 at this stage--it has never even had a development release and seems to be rather unstable.
(Assignee)

Comment 26

6 years ago
(In reply to comment #25)
>   For what it's worth, I wouldn't recommend backporting much of anything from
> 4.2 at this stage--it has never even had a development release and seems to be
> rather unstable.

I agree with Max here. This is a major change to the code which probably depends on some other changes. A good way to break everything. I wouldn't recommend to backport this.
So even if I only pull out the part that displays a textarea for pasting text and using that instead of any uploaded data or url, that will be dependent on various other changes and not be worth the trouble?
Will look into this in more detail once 4.0 is in production.
Whiteboard: [wanted-bmo] → [wanted-bmo][bmo4.0-post]

Comment 29

6 years ago
(In reply to comment #27)
> So even if I only pull out the part that displays a textarea for pasting text
> and using that instead of any uploaded data or url, that will be dependent on
> various other changes and not be worth the trouble?

  Right. There is no "only the part that displays a textarea for pasting text", there's a lot of prerequisite work and a huge patch here that should not be backported.
Duplicate of this bug: 686772
(Assignee)

Updated

6 years ago
Flags: testcase+
(Assignee)

Comment 31

5 years ago
Added to relnotes in bug 713346.
Keywords: relnote
(Assignee)

Updated

5 years ago
Keywords: selenium
Depends on: 850608
(Assignee)

Updated

4 years ago
Blocks: 850608
No longer depends on: 850608
Frederic, for the rest of bugs on b.m.o regressions are usually marked as blocking the originating bug, not vice versa. Is this not the case with the Bugzilla product?
(Assignee)

Comment 33

4 years ago
(In reply to Ed Morley (Away until 13th March) [:edmorley UTC+0] from comment #32)
> Frederic, for the rest of bugs on b.m.o regressions are usually marked as
> blocking the originating bug, not vice versa. Is this not the case with the
> Bugzilla product?

Correct. For us, a regression depends on the original implementation.
Blocks: 1018516
Comment hidden (spam)

Updated

3 years ago
Attachment #8450307 - Attachment description: [http://tonsilpnd.tumblr.com/ http://tonsilpnd.tumblr.com/] → http://tonsilpnd.tumblr.com/
Comment hidden (spam)
(Assignee)

Comment 36

3 years ago
Sam: please stop playing in this bug!! This is not the right place for it.
Comment hidden (spam)
Attachment #8450307 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.