We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22563
    • 63 Posts
    Hi,

    just wanted to ask if someone has an idea for silving this problem(bug):
    The ajaxsearch only works if executed on a "first-level-page" if executed on a lower level page same as above:
    Quote
    The spinner image does its thing, then the form just sits there with the search text still in the field.


    top1 page <- ajax search works
    |- sub1 page <- ajax search does not work

    Thanks
      • 25663 MODX Staff
      • 12,272 Posts
      Are either page cached, and if not is the call cached on one page but not the other?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 22563
        • 63 Posts
        Hi,

        I should have checked this first.
        It seems it is kind of a browser related problem as this only happens with the Opera-Browser.
        huh
          • 29834
          • 2 Posts
          there is a bug, on the ajaxsearch 1.6, when the user is logged and he has several document_groups
          In this case the sql is dg.document_group IN (1%2C2%2C3), instead of dg.document_group IN (1,2,3)

          i modified the function doSearch() in AjaxSearch.inc.php: i ’ve added
          $docgrp=urldecode($docgrp);
          at the beggining of the function

          Thierry
            • 29834
            • 2 Posts
            Another bug with the utf8 encoding: decodeURIComponent is not compatible
            In AjaxSearch.js, the function doSearchResponse crash.
            The solution: the use of the function unescape
            function doSearchResponse(request) {
                var o = $('ajaxSearch_output');
                o.style.opacity = '1';
            
                $('current-search-results').setHTML(unescape(request));
                    newToggle.toggle();
                    is_searching = false;
                    setTimeout('resetForm()',600);
            }
            
              • 33372
              • 1,611 Posts
              Suggestion: How about adding a parents parameter (a la Ditto) to limit search results to only specific subfolders? This could be useful for a number of applications, including subsite/subdomain setups and ShopX product catalog searches. I bet that you could practically copy and paste the code from Ditto to port it over, too.
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options