Skip to main content
The_Real_Mike73
Inspiring
June 22, 2011
Answered

Search returns "null" on first search only

  • June 22, 2011
  • 1 reply
  • 5901 views

RH 8.0.2.208

Air Browser-based Help

When our Help is installed on a clean machine, the first time you search, it returns "null".  Then subsequent searches work normally.

Does anyone have a clue what this could be?  I don't want to discourage users on their first try.

Thanks!

    This topic has been closed for replies.
    Correct answer Praful_Jain

    Hi,

    Please try the solution given below and see if it works fine for you or not. Generate Browser Based AIR Help output.

    Now open the generated output folder and open whfhost.js file in the notepad application. Search for the following strings in the file. you need to replace this function

    function Query()
    {
        gbAIRSearchString  = goOdinHunter.strQuery;
        g_CurPage = 1;
        context = new HuginContext();
        context.reset();
        context.push( goOdinHunter.query, goOdinHunter,
                      processHunterResult, null );
        context.resume();
    }

    With this new function

    function isValidType(obj)
    {
        return ( (typeof(obj)!='undefined')&&(obj!=null) );
    }

    function Query()
    {
        gbAIRSearchString  = goOdinHunter.strQuery;
        g_CurPage = 1;
        if (isValidType(context) && isValidType(context.aTasks))
        {
            while(context.aTasks.length>0)
            {
                context.resume();
            }
        }
        context = new HuginContext();
        context.reset();
        context.push( goOdinHunter.query, goOdinHunter,
                      processHunterResult, null );
        context.resume();
    }

    And try running the output and see if you stilll face the null search result problem

    If this problem is fixed, then you can go to the C:\Program Files\Adobe\Adobe RoboHelp 8\RoboHTML\WebHelp5Ext\template_stock folder location, and make the similar changes in the whfhost.js file located in this folder.

    Do let me know if this fixes the problem or not.

    Note: this should work fine for RH8 and RH9 both.

    thanks

    Praful

    Adobe RoboHelp Team.

    1 reply

    Peter Grainge
    Community Expert
    Community Expert
    June 23, 2011

    That sounds like a problem I had just started noticing with some new builds of AIR help from RoboHelp 9. I have reported it, you should too.

    Please follow this link.


    See www.grainge.org for RoboHelp and Authoring tips

    @petergrainge

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    The_Real_Mike73
    Inspiring
    June 23, 2011

    Thanks for the reply, Peter.  I'm glad to get confirmation anyway.