Results 1 to 5 of 5

Thread: [FIXED][2.2/3.0RC1] No XML response processing on file Uploads

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    May 2009
    Location
    Germany
    Posts
    53
    Vote Rating
    2
      0  

    Default [FIXED][2.2/3.0RC1] No XML response processing on file Uploads

    After uploading a file with a BasicForm and option fileUpload = true, the given XML result won't be proccessed.

    imho the problem is, that in snippet 1 the response is only processed with a given responseText. In snippet 2 responseText is initialized with an empty string, but if the server answers XML, the responseText wont be be touched, so its still empty and afterwards it wont be processed.

    Same Problem is in 2.2 and was discussed in
    http://extjs.com/forum/showthread.php?t=6076

    Snippet 1 source/widgets/form/Action.js line 200:
    Code:
        
        // private
        processResponse : function(response){
            this.response = response;
            if(!response.responseText){
                return true;
            }
            this.result = this.handleResponse(response);
            return this.result;
        },
    snippet 2 source/data/core/Connection.js line 142:
    Code:
            function cb(){
                var me = this,
                  // bogus response object
                  r = {responseText : '',
                       responseXML : null,
                       argument : o.argument},
                  doc,
                  firstChild;
    
                try {
                    doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;
                    if (doc) {
                    if (doc.body) {
                      if (/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)) { // json response wrapped in textarea
                              r.responseText = firstChild.value;
                          } else {
                              r.responseText = doc.body.innerHTML;
                          }
                    } else {
                      responseXML = doc.XMLDocument || doc;
                      // with XML we are here, and responseText is still empty
                    }
                    }
                }
                catch(e) {}

  2. #2
    Sencha User
    Join Date
    May 2009
    Location
    Germany
    Posts
    53
    Vote Rating
    2
      0  

    Default

    Hey there,
    I think this could be a fix:

    source/widgets/form/Action.js line 200:
    Code:
        
        // private
        processResponse : function(response){
            this.response = response;
            if(!response.responseText&&!response.responseXML){
                return true;
            }
            this.result = this.handleResponse(response);
            return this.result;
        },
    regards, Thomas

  3. #3
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Thanks for the bug report.
    Aaron Conran
    @aconran

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,215
    Vote Rating
    1008
      0  

    Default

    Agree with your fix, it's been committed to SVN.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Sencha User
    Join Date
    May 2009
    Location
    Germany
    Posts
    53
    Vote Rating
    2
      0  

    Default

    Thank you for your work and developing this wonderful Framework!

    regards, Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •