Just curious if anything ever happened with this. Thanks,
Janice On Tue, Oct 17, 2017 at 10:07 AM, Peter Desjardins < [email protected]> wrote: > I can give it a try. Once I get my local JS to search for "length," > I'll open a GitHub PR with my changes. > > Peter > > On Tue, Oct 17, 2017 at 8:51 AM, Kasun Gajasinghe <[email protected]> > wrote: > > > > The issue is there in the latest version as well, so we need someone to > fix > > this and send a patch across. > > > > > > On Tue, Oct 17, 2017 at 5:18 PM Janice Manwiller <[email protected]> > wrote: > >> > >> Thank you both - at least I know that we're not crazy, and that there > is a > >> glimmer of hope for addressing it. > >> > >> Kasun, do you mean getting an already updated version of the file? Or > >> making a request to have the file updated? > >> > >> Janice > >> > >> On Tue, Oct 17, 2017 at 3:05 AM, Kasun Gajasinghe <[email protected]> > >> wrote: > >>> > >>> > >>> Interesting observation. I may have found a possible explanation. > >>> > >>> The error is thrown from the line at [1]. > >>> > >>> Quote: > >>> var stemmedWord=stemmer(word); > >>> if(w[stemmedWord]!=undefined){ > >>> stemQueryMap[stemmer(word)] = word; > >>> } else { > >>> stemQueryMap[originalWord]=originalWord; > >>> } > >>> > >>> stemQueryMap is a JavaScript array. 'length' is a default property that > >>> return the number of elements of the given array. An assignment like > >>> stemQueryMap["length"] = "length" will modify this 'length' property. > Since > >>> the new value is not an integer, Chrome's Javascript engine goes > haywire. > >>> > >>> >> You can recover from this by clearing the cookies. << > >>> > >>> Best possible fix for this is that JS engines should start treating > >>> 'length' as a keyword. Since that is a long shot, easiest workaround > is to > >>> patch the nwSearchFnt.js IMO - where we ask it to treat 'length' as a > >>> special keyword. > >>> > >>> We should do this for all the Array objects in there such as > >>> stemmedWordsList, cleanwordsList, wordsList. > >>> > >>> @Janice, are you interested in sending a GitHub pull request for this? > :) > >>> > >>> [1] > >>> https://github.com/docbook/xslt10-stylesheets/blob/ > master/xsl/webhelp/template/search/nwSearchFnt.js#L383 > >>> [2] > >>> https://developer.mozilla.org/en-US/docs/Web/JavaScript/ > Reference/Global_Objects/Array/length > >>> > >>> Best regards, > >>> KasunG > >>> > >>> On Tue, Oct 17, 2017 at 9:11 AM, Peter Desjardins > >>> <[email protected]> wrote: > >>>> > >>>> I can confirm that I see the same behavior in our webhelp. Searching > >>>> for the term "length" will result in the same JS error. > >>>> > >>>> The search function is working as expected otherwise. Interesting > >>>> problem! > >>>> > >>>> Peter > >>>> > >>>> On Mon, Oct 16, 2017 at 5:00 PM, Janice Manwiller <[email protected]> > >>>> wrote: > >>>> > This issue has been reported by a couple of internal users of our > >>>> > WebHelp. > >>>> > Has anyone run into something similar? And if so, any ideas of how > to > >>>> > address? > >>>> > > >>>> > I have never seen the behavior myself. > >>>> > > >>>> > Our WebHelp is built using the Maven docbx plugin. > >>>> > > >>>> > When using the WebHelp in Chrome, the user issues a search - in this > >>>> > case, > >>>> > specifically for the term "length". > >>>> > > >>>> > They get no results, and the search/contents sidebar disappears. > They > >>>> > are > >>>> > unable to get it back unless they restart Chrome, which destroys all > >>>> > of > >>>> > their work in the main application. > >>>> > > >>>> > The Chrome console has the following: > >>>> > > >>>> > nwSearchFnt.js:383 Uncaught RangeError: Invalid array length > >>>> > at tokenize (nwSearchFnt.js:383) > >>>> > at Effectuer_recherche (nwSearchFnt.js:158) > >>>> > at Verifie (nwSearchFnt.js:100) > >>>> > at HTMLDocument.<anonymous> (main.js:68) > >>>> > at o (jquery-1.7.2.min.js:2) > >>>> > at Object.fireWith (jquery-1.7.2.min.js:2) > >>>> > at Function.ready (jquery-1.7.2.min.js:2) > >>>> > at HTMLDocument.B (jquery-1.7.2.min.js:2) > >>>> > > >>>> > > >>>> > > >>>> > Any help is appreciated. > >>>> > > >>>> > Thanks, > >>>> > > >>>> > Janice > >>>> > > >>>> > -- > >>>> > Janice Manwiller > >>>> > Principal Technical Writer > >>>> > Sqrrl Data, Inc. > >>>> > www.sqrrl.com | @SqrrlData > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: [email protected] > >>>> For additional commands, e-mail: [email protected] > open.org > >>>> > >>> > >>> > >>> > >>> -- > >>> ~~~*******'''''''''''''*******~~~ > >>> Kasun Gajasinghe > >>> Senior Software Engineer; WSO2 Inc.; http://wso2.com, > >>> Linked-in: http://lk.linkedin.com/in/gajasinghe > >>> Blog: http://blog.kasunbg.org > >>> > >>> > >>> GitHub: http://github.com/kasunbg > >> > >> > >> > >> > >> -- > >> Janice Manwiller > >> Principal Technical Writer > >> Sqrrl Data, Inc. > >> www.sqrrl.com | @SqrrlData > > > > -- > > ~~~*******'''''''''''''*******~~~ > > Kasun Gajasinghe > > Senior Software Engineer; WSO2 Inc.; http://wso2.com, > > Linked-in: http://lk.linkedin.com/in/gajasinghe > > Blog: http://blog.kasunbg.org > > > > > > GitHub: http://github.com/kasunbg > -- Janice Manwiller Principal Technical Writer Sqrrl Data, Inc. www.sqrrl.com | @SqrrlData
