All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

A PHP Error was encountered

leeaston 7 Feb 2013 13:36 question, complete

Hi Low, I'm getting these errors when submitting a search with the search box empty.

A PHP Error was encountered
Severity: Notice

Message: Undefined variable: tag

Filename: low_search/ext.low_search.php

Line Number: 417

A PHP Error was encountered
Severity: Warning

Message: implode() [function.implode]: Invalid arguments passed

Filename: low_search/ext.low_search.php

Line Number: 521

Replies

  1. Low 7 Feb 2013 13:40

    That might the hack you just added. Can you check that the line you added is inside this block:

    if ($keywords && ($tag = @...)) 
    {
    // highlight keywords in excerpt
    // highlight keywords in title
    }

  2. leeaston 7 Feb 2013 13:57

    Initially I had this, as you didn't mention the curly brackets:


    // Hilite keywords?
    if ($keywords && ($tag = @$this->settings['excerpt_hilite']))
    $row['title'] = $this->_highlight_keywords($params,
    $row['title'], $tag);


    I've now changed it to this but still have the same problem:


    if ($keywords && ($tag = @$this->settings['excerpt_hilite']))
    {
    $row['title'] = $this->_highlight_keywords($params,
    $row['title'], $tag);
    }

  3. Low 7 Feb 2013 14:00

    The entire block should be like this: https://gist.github.com/lodewijk/4731087

    Pretty sure it's a misplaced } somewhere.

  4. leeaston 7 Feb 2013 14:12

    Thanks for your time. I did the insertion on the wrong line as I'd made previous changes above.

  5. Low 7 Feb 2013 14:28

    So it's working again now?

  6. leeaston 7 Feb 2013 14:35

    Yes it is, thanks for asking.

    I would prefer that is a search term is not entered and the form submitted that the user remains on the same page, and not taken to the results page.

    Going to the results page and seeing 1000's of entries when no search term is submitted is pointless. Google, Bing and Yahoo all do nothing, i.e. return no results when no search term is entered.

    Is this possible with Low Search?

    Have to say it's a breath of fresh air coming from Super Search - feels faster and it's much easier to understand LS - feel like I'm in control!

  7. Low 7 Feb 2013 14:38

    Yes, add required="keywords" to the Form tag. It will redirect you back to the page where the form was submitted if no keywords were given. JavaScript is also an option, of course.

    And thanks for the compliment. :)

  8. leeaston 7 Feb 2013 14:39

    Yo man!