attachment mime type was spread over two lines

Bug #220758 reported by Tormod Volden
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Incomplete
Undecided
Unassigned

Bug Description

Using LP beta, I can not change the mime type of an attachment. The form now has ";" appended to the old value, and complains about constraints whether I just keep the old value or try to change it.

https://bugs.edge.launchpad.net/ubuntu/+source/xscreensaver/+bug/220408/attachments/281088

Tags: lp-bugs
Revision history for this message
Diogo Matsubara (matsubara) wrote :

I was able to edit the Content type from text/plain to text/html using staging.launchpad.net
Can you elaborate further what do you mean by: "The form now has ";" appended to the old value? What's the content type you're trying to set?

Thanks for the report

Changed in malone:
status: New → Incomplete
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Sorry, I found out how to change it but forgot to report back here. Anyway, look at https://bugs.edge.launchpad.net/ubuntu/+source/xscreensaver/+bug/220408/attachments/281087 for the original issue. The problem is that the value is spread over two lines (separated by ";" and newline), and just editing the first line (because you don't see the second) will keep the second line unchanged and make for an invalid input value. Once I deleted the second line of the input field contents, it worked.

The question is how did the original poster end up with a 2-line value in these fields? Broken web client, or bug in LP?

Revision history for this message
Tormod Volden (tormodvolden) wrote :

For the record, the field value is:
text/plain;
 name="Xorg.0.log"

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Hi Tormod, after some investigation with help from Graham Binns, we figured that the attachment with the wrong content type came from the email interface.
A fix for this problem is already committed and you can track it on bug 208185, to be released next week.

It's not possible to set the content type when adding an attachment using the web UI. It's only possible to set the content type while editing it. Are you ok with me converting this bug report to request better validation for the content type field using the web ui?

I was unable to trigger the constraints validation error you mentioned. I couldn't paste a 2-line value in the field. Let me know what you did. Thanks

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Diogo, I am not sure we understand each other :) I did not paste in or set those values. The original reporter of that bug did, maybe as you and Graham concluded, using the email interface. So what has this do to with "better validation for the content type field using the web ui" ? In the web interface I would get the constraint error when clicking on "Change" without having touched the value.

I am pretty sure it's impossible to insert a 2-line value using the web ui. This is probably a bug in the email interface. But bug 208185 is about having attachments added involuntary, not about the content-type value being fed with an invalid value. Of course, maybe the new fix also fixes this, but that's not clear from the comments.

I see the example in bug 208185 also has the "name=" thing added to the content type, but on one line. In the attachment I linked to, the "name=" thing was on a second line of that value. Now it isn't any longer, I guess you have changed it while investigating.

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Hi Tormod,

I thought you had edited the attachment mime type using the web ui and sucessfully entered a 2-line value. Since that's not the case and since bug 208185 also fixed the email interface, I'm duplicating this one against it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.