ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Certain search terms result in a blank 'results' page

November 30, 2010 12:25pm

Subscribe [5]
  • #1 / Nov 30, 2010 12:25pm

    jonathanmelville

    132 posts

    I have a client in the health care industry who posts primarily health-related articles to their site. Certain search terms will correctly return a results page. However, other terms result in the page being blank.

    The page is located at http://summittotalhealth.com and she search box is in the right-hand column toward the bottom.

    To test this, search for the term ‘pills’. You will get a correct search results page.

    Now, search for ‘fat’. You will get a blank page. Does anybody have a clue what is causing this? My client is POed and I don’t know what to say…

  • #2 / Nov 30, 2010 12:44pm

    Joe Paravisini

    50 posts

    You will need to create a “no results” template and add this parameter to your search form:

    no_result_page=“path_to_no_results_template”

  • #3 / Nov 30, 2010 12:45pm

    nth

    2 posts

    Thanks but that’s not the problem. EE displays a default “your search returned no results” page if it doesn’t find anything matching the search term.

    This is a different problem.

  • #4 / Nov 30, 2010 2:40pm

    Joe Paravisini

    50 posts

    Ah, my bad, I read your post too quickly. Can you turn on template debugging and such?

  • #5 / Nov 30, 2010 4:15pm

    nth

    2 posts

    I tried to turn on debugging and it does output all of the debug information, just not any results… and nothing looked out of the ordinary either. Any more ideas? I’m now running a local copy of the site so I can tinker w/ it without damaging the live version.

  • #6 / Dec 01, 2010 2:59am

    John Henry Donovan

    12339 posts

    jonathanmelville,

    What version and build of EE are you using?
    Are you using any add-ons?

    Have you tested without the htaccess and the index.php back in place?

    Can you share your search tags?

    Can you turn on some error reporting to see if the blank page returns an error?

  • #7 / Dec 01, 2010 4:24pm

    jonathanmelville

    132 posts

    Hey John,

    Thanks for chiming in. This is very frustrating!

    I am running EE 1.7, build 20101018.

    I was using .htaccess to remove index.php but I disabled it and the problem remains, so that’s not it.

    Error reporting: I caused it to bring up a blank page and immediately checked my php error log. I received the following error:

    [01-Dec-2010 15:18:33] PHP Parse error:  syntax error, unexpected T_STRING in /Applications/MAMP/htdocs/summittotalhealth/sum_hea_sys/core/core.functions.php(663) : eval()'d code on line 72

    Here is my search code:

    {embed="includes/head" pageTitle="Search Results for '{exp:search:keywords}'"}
    <body id="search-results" class="no-bk-main">
        <div id="wrapper">
            <div id="container">
                {embed="includes/pageTop"}
                <div id="content" class="png_bg">
                    <div id="main">
                        <div id="services_intro">
                            {exp:search:search_results}
                        <div class="searchResult">
                            <h3><a href="http://{auto_path}">{exp:search_marker}{title}{/exp:search_marker}</a></h3>
    <p>                        <div class="timeStamp"><span class="strong">Published on {entry_date format="%l, %F %d, %Y"}</div><br />
                            {if "{article_teaser}"}{exp:search_marker}{article_teaser}{/exp:search_marker}{/if}<br />
                            {if "{vid_summary}"}{exp:search_marker}{vid_summary}{/exp:search_marker}{/if}<br />
                        </div><br />
                         {/exp:search:search_results}<br />
                        {if paginate}<br />
                        {paginate}<br />
                        {/if}<br />
                        </div><br />
                    </div><br />
                    {embed="includes/sidebar"}<br />
                    <div class="clear"></div><br />
                </div><br />
                {embed="includes/footer"}<br />
            </div><br />
        </div><br />
    </body><br />
    </html>

    I am using the search_marker plugin, but I disabled that just to check and it still results in a blank page, so I don’t think that’s the problem.


    I hope this helps…

  • #8 / Dec 02, 2010 10:10am

    jonathanmelville

    132 posts

    Any ideas about this?

  • #9 / Dec 03, 2010 2:37am

    John Henry Donovan

    12339 posts

    Jonathan,

    We answer threads in sequentially in rotation so unfortunately if you bump your post you actually go back to end of our support queue without our knowledge so sorry for lack of reply.

    Can you try the default search results template code from the docs and nothing else. No embeds etc

    Also check with your host that you have no mod_security restrictions

  • #10 / Dec 08, 2010 2:14pm

    jonathanmelville

    132 posts

    Hi John,

    I am running a duplicate copy of the site on my local machine for testing, so I can confirm that mod_security is not causing the problem.

    Tried using the default search results template as you suggested, and low and behold it worked. So that is interesting. Where do you recommend I go from here?

  • #11 / Dec 09, 2010 10:39am

    Sue Crocker

    26054 posts

    If the default search result template works for you, and your custom template does not, you’ll need to take the default template and add complexity until you figure out what is causing the problem.

  • #12 / Dec 10, 2010 12:59pm

    jonathanmelville

    132 posts

    I have solved this problem. This line was causing certain search terms to result in a blank page:

    {if "{article_teaser}"}{exp:search_marker}{article_teaser}{/exp:search_marker}{/if}

    I changed it to {if "article_teaser"....} and it worked. Thanks for the help.

  • #13 / Dec 11, 2010 2:46pm

    Greg Salt

    3988 posts

    Hi Jonathan,

    Glad that you got this resolved. Please post back if required.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases