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

Support archive

Unknown modifier - bug?

leeaston 23 Mar 2013 23:27 question, complete

I put this:

Splitting declaration on materials / labour charges

into a search box and got this:

---

A PHP Error was encountered

Severity: Warning

Message: preg_split() [function.preg-split]: Unknown modifier '|'

Filename: low_search/ext.low_search.php

Line Number: 477

---

A PHP Error was encountered

Severity: Warning

Message: preg_replace() [function.preg-replace]: Unknown modifier '|'

Filename: low_search/ext.low_search.php

Line Number: 548

---

Is this a bug, seem the / character causes a problem?

Thanks
Lee

Replies

  1. Low 24 Mar 2013 11:15

    Where exactly are you putting this query? Front-end templates? Find & Replace utility in LS?

    And what version of Low Search are you using?

  2. leeaston 24 Mar 2013 11:33

    LS 2.2.1. I'm putting the query in front-end templates. Not very pretty, but here's the template:

    {exp:low_search:form collection="blog|auto-entrepreneur|sarl-eurl|legal-structure|business-registration|social-financial-help|health-care-carte-vitale|gites-chambres-tables-dhotes|forms|general-discussion" search_mode="all" result_page="search" query="{segment_2}" secure="no" required="keywords"}


    {/exp:low_search:form}

    -------------------------
    Results page:

    {exp:low_search:results encode="no" query="{segment_2}" search:title limit="10" paginate="bottom"}

  3. Low 24 Mar 2013 12:20

    Indeed, looks like a bug when the forward slash appears in the keywords *and* is highlighted in the excerpt. To fix, open op ext.low_search.php in a text editor and look up this on lines 321 and 322:

    $kw = explode(' ', $kw); 
    $kw = array_map('preg_quote', $kw);


    Replace those two with these lines:

    $kw = preg_quote($kw, '/'); 
    $kw = explode(' ', $kw);

  4. leeaston 24 Mar 2013 16:13

    Thanks Low. Appreciate the help on a Sunday!