We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27672
    • 168 Posts
    when i do a search with this snippet call:

    [!AjaxSearch? &ajaxSearch=`0` &parents=`1` &tplLayout=`ajaxSearchCustomTpl` &submitText=`Refine Search` !]

    my results come up fine, but when you click on any of the results you get the following error:

    PHP error debug
    Error: preg_replace() [function.preg-replace]: Compilation failed: lookbehind assertion is not fixed length at offset 11
    Error type/ Nr.: Warning - 2
    File: /www/local/sites/www014/manager/includes/document.parser.class.inc.php(746) : eval()’d code
    Line: 100

    if i change my snippet call to:

    [!AjaxSearch? &ajaxSearch=`0` &parents=`1` &tplLayout=`ajaxSearchCustomTpl` &submitText=`Refine Search` &highlightResult=`0` !]

    you can click on the links and everything is fine, just no result highlighting, so the problem obviously lies in that plugin. i did some searching and found results saying:

    "Update: SOLUTION FOUND! (thanks coroico for the link)
    There is an error in the search highlighting plugin.
    Inside the modx manager, click on
    Elements > manage elements > plugins > Search Highlighting plugin
    On line 123 (if you copy to your line-numbered text editor, right near the bottom of the code)
    Replace: $output = implode("<body>", $body);
    With: $output = implode("<body", $body);
    Hope that helps someone else"

    in my plugin code (my initial install was 1.0.1, since upgraded to 1.0.2, so that’s where the plugin code came from), line 124 already says "$output = implode("<body", $body);", i tried changing it to <body> and some other things, but nothing worked.

    anyone know of a solution? code result highlighting is not 100% necessary in this application, but it’d be nice if it’s not too hard to get working. thanks.
      • 27672
      • 168 Posts
      the search highlight is:

      "Plugin: Search_Highlight v1.4a"

      i have found this might be an issue with the PCRE library, and that down-grading search highlight to v1.3 might fix it, has anyone had this work? if so - where might i find v1.3?
        • 34018 ☆ A M B ☆
        • 100 Posts
        I have the same problem with my website.

        I couldn’t figure it out, if I discover something I post here.
          ----
          Daniel Melo
          • 5811
          • 1,717 Posts
          To get the v1.3a release follow this link and select the previous releases button.

          The Plugin: Search_Highlight v1.4a is provided with the ajaxSearch release 1.8.3a
            • 25469
            • 7 Posts
            Same Problem over here sad
            I’ll try the older version of the Plugin...
              • 332
              • 23 Posts
              hi, having the same issue. i tried the previous version of the plugin, but no luck. Anyone solve this?
                • 28889
                • 6 Posts
                This seems to be a bug in php:
                http://bugs.php.net/bug.php?id=38327&edit=1
                http://www.regex-tester.de/11_regex_warning_Lookbehind-assertion-is-not-fixed-length.html
                I didn’t completely get it, but as far as I understood the REGEX cannot find the starting point for the pattern.
                I tried to change the $lookBehind in the searchHighlight Plugin.
                With $lookBehind =’/(?<=)’;
                it works fine.
                Unfortunately the regexp that avoids a match with a html entity is deactivated through this hack. Perhaps somebody else with better regex knowledge knows how to extend the original $lookBehind = ’/(?<!&|&[^;]|&[^;][^;]|&[^;][^;][^;]|&[^;][^;][^;][^;]|&[^;][^;][^;][^;][^;])’; so that there is no negative Lookbehind.
                Kind regards H