Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357275 - Zip import broken
Summary: Zip import broken
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: 0.3 RC1   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 351347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-09 14:54 EDT by John Arthorne CLA
Modified: 2011-10-04 09:00 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-09-09 14:54:34 EDT
0.3 M1

Import from zip is broken. Tested on IE 9, FF6, Chrome 13.

Error:

HTML Upload Error:h.getElementsByTagName("textarea")[0] is undefined
form:this.form,handleAs:"json",error:b...ghContrastImage" alt=""\n/></div>'});
built-table.js (line 779)
TypeError: h.getElementsByTagName("textarea")[0] is undefined
"xml"){if(b.isIE<9||b.isIE&&b.isQuirks...Next();return a});e.ioArgs._callNext=
built-table.js (line 766)
TypeError: h.getElementsByTagName("textarea")[0] is undefined
"xml"){if(b.isIE<9||b.isIE&&b.isQuirks...Next();return a});e.ioArgs._callNext=
Comment 1 John Arthorne CLA 2011-09-09 14:57:03 EDT
This is broken on orionhub and orion.eclipse.org, but works on localhost. Possibly related to build/minification.
Comment 2 Mark Macdonald CLA 2011-09-23 16:20:50 EDT
(In reply to comment #1)
> This is broken on orionhub and orion.eclipse.org, but works on localhost.
> Possibly related to build/minification.

It looks like the file upload does succeed, but the dialog stays open and the UI doesn't refresh which gives the impression that the whole operation failed. What makes this really weird is that I can reproduce the problem on orion.eclipse.org, but not on my local server which is running the same build (same minification, etc).
Comment 3 Susan McCourt CLA 2011-09-26 11:51:42 EDT
*** Bug 351347 has been marked as a duplicate of this bug. ***
Comment 4 Szymon Brandys CLA 2011-09-26 12:41:02 EDT
It looks like a problem with the widget itself. We do not call any getElementsByTagName("textarea")[0] on our side, so it must be somewhere in the widget code.
Comment 5 Mark Macdonald CLA 2011-09-26 15:00:02 EDT
(In reply to comment #4)
> It looks like a problem with the widget itself. We do not call any
> getElementsByTagName("textarea")[0] on our side, so it must be somewhere in the
> widget code.

This statement is in dojo code (dojo/io/iframe.js). It fails due to a problem parsing the server response during import.

On localhost, my server returns:
> HTTP/1.1 201 Created
> Location: /fileaz
> Content-Encoding: gzip
> Content-Length: 54
> Server: Jetty(6.1.x)
> 
> <head></head><body><textarea>{}</textarea></body>

But on orion.eclipse.org:
> HTTP/1.1 201 Created
> Date: Mon, 26 Sep 2011 18:25:33 GMT
> Server: Jetty(6.1.x)
> Location: /fileCx
> Content-Encoding: gzip
> Content-Length: 54
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: text/plain   <-----------
> 
> <head></head><body><textarea>{}</textarea></body>

Note the "text/plain" header -- this causes the browser to parse the document as plaintext, so <textarea> becomes <pre>&lt;textarea&gt;</pre> and everything breaks. Not sure why this is different on my local box (maybe Windows vs. Linux?)
Comment 6 Susan McCourt CLA 2011-10-03 11:16:40 EDT
John, do you have time to look at this?  If not, we should assign to someone so it doesn't get lost...
Comment 7 John Arthorne CLA 2011-10-03 16:03:26 EDT
I have pushed a fix. I will verify on orion.eclipse.org tomorrow:

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=47b221c3b28c0bea73a96a2a86e009b154bb3dc2
Comment 8 John Arthorne CLA 2011-10-04 09:00:10 EDT
Fixed and regression test added. Verified in I20111003-2200 on orion.eclipse.org.