History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4532
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P1 P1
Assignee: Unassigned
Reporter: André Bargull
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Two typos in "LzHTTPDatasource#doRequest(..)"

Created: 20/Aug/07 01:20 PM   Updated: 24/Oct/07 01:53 PM
Component/s: LFC - Data
Affects Version/s: 4.0.3, 4.0.5WaffleCone
Fix Version/s: 4.0.5WaffleCone

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 6,268
Runtime: N/A
Flags: External
Fix in hand: True


 Description  « Hide
"LzHTTPDatasource#doRequest(..)":

There's one obsolete if-clause, as "if (q.length > 0)" is always true, because "q" will have at minimum a length of "1".
[code]
var q = '?'

...

if (querystring != null && querystring.length > 0) {
  if (q.length > 0) {
    q += sep + querystring;
  } else {
    q = querystring;
  }
}

...
[/code]

So we can say:
[code]
...
if (querystring != null && querystring.length > 0) {
  q += sep + querystring;
}
...
[/code]

---

Second issue:
If we have got a question mark in the url, we must say "q.substring(1)", or else we'll have got two question marks in our final url, as "q" starts always with a question mark.
[code]
var q = '?';

...

var url = this.src
if (q == "?") {
  // don't add empty args list
} else {
  // if there are already query args in the url, separate them with a '&'
  if (url.indexOf('?') >= 0) {
    url = url + "&" + q;
  } else {
    url = url + q;
  }
}

...
[/code]

So this should be:
[code]
...
var url = this.src
    if (q == "?") {
        // don't add empty args list
    } else {
        // if there are already query args in the url, separate them with a '&'
        if (url.indexOf('?') >= 0) {
            url = url + "&" + q.substring(1);
        } else {
            url = url + q;
        }
    }
...
[/code]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Henry Minsky - 21/Aug/07 08:06 AM
Thanks, I will merge these changes in. Note that we are changing from using HTTPDataSource to the new HTTPDataProvider API, I will put these changes into the HTTPDataProvider code.


Henry Minsky - 28/Aug/07 11:31 AM
Change 20070828-hqm-0 by hqm@IBM-2E06404CB67 on 2007-08-28 14:18:33 EDT
    in /cygdrive/c/users/hqm/openlaszlo/wafflecone3
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: LPP-4584 duplicate ondata events
LPP-4532 fixes for querystring merging

New Features:

Bugs Fixed: LPP-4584 LPP-4532
Bugs: LPP-4584 LPP-4532

Technical Reviewer: hminsky
QA Reviewer: pbr
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

fix to only create one delegate for handling ondata events

fix to querystring merging to account for '?' char



Tests:

test/lfc/data/alldata.lzx
test/smoke/smokecheck.lzx

Files:
M WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
M WEB-INF/lps/lfc/data/LzDataset.lzs






Mamye Kratt - 24/Oct/07 01:53 PM
(trunk local build r6967)