From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 8D726E003D9; Wed, 19 Aug 2015 04:25:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.181 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id E3409E00349 for ; Wed, 19 Aug 2015 04:25:32 -0700 (PDT) Received: by wicja10 with SMTP id ja10so5289029wic.1 for ; Wed, 19 Aug 2015 04:25:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=3dYFtDzlOLBsVLIO6sZBXpUcF5kRiCqJdwUTWlMYSTo=; b=WJgVoi8iQfGtqa0Iv2I43WmIcNOEefsYg7UaagkzTQauA9CNSF5Pk6KqVdOCh/vOoR VSywfD2jtUyxARiI0ErvYtnVtYXuVsbA0VtJkAB5o0VFHugayeION/XHi+cvmGwCLWCP 7V1hV7ewmqOej9dy0DA7fCs1wxQzwBkYjt32E2coj+Xizf5/bWo2gkql6z7eIfpPO+16 D2s5dV7p7UNdXMtpGBt5P3nBkEfMzqIosX1M3AdEGtDcF3/KDnhT/dlOwblaNsvB3fDE L5Z8P/Ey5RkfXV4crQwrWEfKBr274/0wNGa8aB8VknNW1INJ667fqD+gdQy3LDr8oONx GWmw== X-Gm-Message-State: ALoCoQn/0w/aRgLk24VDbb8yhXSn4Q3iWozkkkbJW4Qwhsmt2YJER2EgleSMzSbx6fJOoisjE8Uy X-Received: by 10.180.76.177 with SMTP id l17mr2249281wiw.14.1439983531591; Wed, 19 Aug 2015 04:25:31 -0700 (PDT) Received: from [192.168.2.139] ([83.217.123.106]) by smtp.googlemail.com with ESMTPSA id j2sm616884wjq.5.2015.08.19.04.25.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2015 04:25:31 -0700 (PDT) Message-ID: <55D467A5.5050508@intel.com> Date: Wed, 19 Aug 2015 12:25:25 +0100 From: Michael Wood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: "Reyna, David" , "BARROS PENA, BELEN" References: <5E53D14CE4667A45B9A06760DE5D13D0825AD2DD@ALA-MBA.corp.ad.wrs.com> In-Reply-To: <5E53D14CE4667A45B9A06760DE5D13D0825AD2DD@ALA-MBA.corp.ad.wrs.com> Cc: "toaster@yoctoproject.org" Subject: Re: [review-request] [PATCH] dreyna/dir_expand_7810 X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 11:25:37 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 19/08/15 08:34, Reyna, David wrote: > Hi Belén, > > I have pushed a fix for 7810: > dreyna/dir_expand_7810 > > It is very strange. The problem was that the AJAX call in "dirinfo.html" expects the response data to be a JSON-formatted string, and uses "parseJSON()" to convert that into a JS object for display computation. > > However, in debugging the code I found that the JS debugger recognized the "response" to now _already_ be a proper JS object, and the observed failure in the defect is that "parseJSON()" tries to convert it and immediately hits a syntax error. > > The fix is to simply skip the "parseJSON()", and now it all works. But I do not know why the AJAX operation changed, unless it was updated to take the JSON format indicator and perform the conversion automatically now, which would explain why it works the way it does. > > In any case, I have kept a note in the the patch indicated how "parseJSON()" is no longer needed, in case someone in the future puzzles over this. > > - David > Yes you're right, when an ajax call gets a JSON response it's automatically parsed to a js object. Previously the response it was getting was just a text/other response and therefore the manual parse was needed. In commit: commit c5a16235b8b56102703bc264768ba386ebe90611 Author: Alexandru DAMIAN Date: Mon May 11 18:58:25 2015 +0100 bitbake: toaster: fix html5 compliance This patch brings needed changes in all views so that each view passes the HTML5 compliance test by the W3C Markup Service. This was changed: - return HttpResponse(_get_dir_entries(build_id, target_id, top)) + return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json") So the response type is now (correctly) marked as json and the ajax call does the automatic parsing. I don't think there is a need for the " /* object ready, no need for $.parseJSON(response); */" comment as this is the expected behaviour. So I’ll submit the patch without this if that's OK. Thanks, Michael