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.

EE1.6 Simple Search

June 25, 2007 2:59pm

Subscribe [3]
  • #1 / Jun 25, 2007 2:59pm

    Boyink!

    5011 posts

    Trying to implement simple search on a EE 1.6 site and getting the following error:

    The search path contains an error. Please contact the system administrator.

    Code is as follows:

    {exp:search:simple_form no_results_page="search/no_results" result_page="search/results"}
        <input type="text" class="text" name="keywords" id="keywords"/>
        <input type="image" value="submit" src="{site_url}images/interface/btn-search.gif" alt="search" />
    {/exp:search:simple_form}

    Search form is in an embedded template
    Both results and no results templates exist
    Double-checked permissions on config file
    Index.php has been renamed
    Cleared all caches

  • #2 / Jun 25, 2007 3:16pm

    Lisa Wess

    20502 posts

    Have you checked Admin -> Weblog Administration -> Weblog Management -> Edit Weblog -> Search Path URL?  Make sure that is filled in?

  • #3 / Jun 25, 2007 3:20pm

    Boyink!

    5011 posts

    No…I thought those were just for creating paths in the results?

    I’m getting this error right after submitting the initial search.

  • #4 / Jun 25, 2007 3:26pm

    Lisa Wess

    20502 posts

    I copy and pasted your code and other than a missing image it worked perfectly.  The main difference may be that I have that path filled out and you don’t, so if you can give that a shot, that’d be great =)

  • #5 / Jun 25, 2007 3:32pm

    Boyink!

    5011 posts

    if you can give that a shot, that’d be great =)

    I can no longer hear that combination of words in anything other than an Office Space voice… 😊

    I went and filled in search paths for all 13 weblogs (just pointing them at the home page) and still get the error.

  • #6 / Jun 25, 2007 4:10pm

    Lisa Wess

    20502 posts

    Well, I found in the code what would trigger that error:

    // The search results template is specified as a parameter in the search form tag.
            // If the parameter is missing we'll issue an error since we don't know where to 
            // show the results
            
            if ( ! isset($_POST['RP']) OR $_POST['RP'] == '')
            {
                return $OUT->show_user_error('general', array($LANG->line('search_path_error')));
            }

    But it doesn’t make any sense since you do, indeed, have that parameter and copy/pasting your code doesn’t give me the error.  Are you running any extensions perchance?

    I was examining the parameters, though - If you try no_result_page (result singular not plural as in yours) does that clear it up?  From the docs, no_result_page is the proper parameter.

  • #7 / Jun 25, 2007 4:25pm

    Boyink!

    5011 posts

    Hmmm - the docs suggest that “search/results” is a default that is used if the result page is not specified - link.

    Installed Extensions are now:
    NoFocus (v.1.0.0)
    Edit Tab AJAX (v.1.0)
    Multi Relationship (v.1.0.4)
    Gallery dropdown (v.1.0.0)

    No change with the singular version.

  • #8 / Jun 25, 2007 4:46pm

    Lisa Wess

    20502 posts

    I’m going to need to look into this a bit more, Michael. I’ll come back as soon as I have more information.

  • #9 / Jun 25, 2007 5:22pm

    Derek Jones

    7561 posts

    Michael can you share a link to the page this is occurring on?  Or cut and paste the rendered <form> tagblock from the HTML source of the page with the search tag on it?  Let’s first make sure all the fields are in place.

  • #10 / Jun 26, 2007 4:19pm

    Boyink!

    5011 posts

    Sorry - got sidetracked.

    The site’s in development yet so here’s the rendered code:

    <form action="" class="search">
        <div>
        <form method="post" action="(site's URL removed)"  >
        <div>
        <input type="hidden" name="ACT" value="19" />
        <input type="hidden" name="XID" value="f0fab68239ad3c43e675d36eb2dd7f5c08787aac" />
        <input type="hidden" name="RP" value="search/results" />
        <input type="hidden" name="NRP" value="search/no_results" />
        <input type="hidden" name="RES" value="" />
        <input type="hidden" name="status" value="" />
        <input type="hidden" name="weblog" value="" />
        <input type="hidden" name="search_in" value="" />
        <input type="hidden" name="where" value="all" />
        <input type="hidden" name="site_id" value="1" />
        </div>
    <input type="text" class="text" name="keywords" id="keywords"/>
    <input type="image" value="submit" src="(site URL removed)/btn-search.gif" alt="search" />
    </form>

    The EE code is:

    <form action="" class="search">
    <div>
    {exp:search:simple_form no_result_page="search/no_results" result_page="search/results"}
        <input type="text" class="text" name="keywords" id="keywords"/>
        <input type="image" value="submit" src="{site_url}images/interface/btn-search.gif" alt="search" />
    {/exp:search:simple_form}
    </div>
    </form>

    If need be I can PM/Email the URL and/or a login.

  • #11 / Jun 26, 2007 4:31pm

    Derek Jones

    7561 posts

    Do you have any .htaccess?  The “RP” field is definitely in the form data, which a lack thereof is what triggers this error.  If your .htaccess is doing a redirect, then POST data will be destroyed.

  • #12 / Jun 26, 2007 4:34pm

    Boyink!

    5011 posts

    Yep - I have the following to change index.php to “na”:

    DirectoryIndex na index.php index.shtml index.html index.htm
    
    <Files na>
    ForceType application/x-httpd-php
    </Files>
  • #13 / Jun 26, 2007 4:36pm

    Derek Jones

    7561 posts

    That shouldn’t affect it.  No .htaccess in a parent directory up the tree?  If not, go ahead and email (not PM, please) the info over to me and I’ll have a look.

  • #14 / Jun 26, 2007 4:43pm

    Boyink!

    5011 posts

    Nope - thats the only htaccess file on the site.

    Email sent.

  • #15 / Jun 26, 2007 5:03pm

    Derek Jones

    7561 posts

    Not sure why I didn’t notice it on your code block above, but why do you have a form tag wrapping around the simple search form tag?  That’s what’s causing the issue.

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

ExpressionEngine News!

#eecms, #events, #releases