Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7433

Patch from CRM-6135 breaks delay setting in autocomplete

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2.5, 3.3.1, 3.3.2
    • Fix Version/s: 3.4.alpha
    • Component/s: CiviCRM Search
    • Labels:
      None

      Description

      The autocomplete.ff-linux.txt on CRM-6135 ( originally from http://plugins.jquery.com/node/14682 ) breaks the jquery.autocomplete delay mechanism and triggers an AJAX search request after every key press right away instead of doing so only after delay ms without any further key press, so causing lots of unnecessary search requests and extra server load.

      I've for now added a workaround that only binds "input" to onChange() if minChars is 1 (or less) so that things should still work for Chinese settings while at the same time changing minChars to 3 in the template, in the long run the minChars setting should probably become a search configuration setting as starting searches after the first character right away does not really make sense for most languages either ...?

      === modified file 'packages/jquery/plugins/jquery.autocomplete.js'
      — packages/jquery/plugins/jquery.autocomplete.js 2011-01-03 09:35:11 +0000
      +++ packages/jquery/plugins/jquery.autocomplete.js 2011-01-21 18:56:43 +0000
      @@ -196,8 +196,12 @@
      $input.unbind();
      $(input.form).unbind(".autocomplete");
      }).bind("input", function()

      { - onChange(0, true); - }

      );
      + // needed for chinese input? see CRM-6135 and http://plugins.jquery.com/node/14682
      + // this breaks "delay" though, so lets only use it with chinese minChars setting
      + if (options.minChars <= 1)

      { + onChange(0, true); + }

      + });

      function selectCurrent() {
      var selected = select.selected();

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              hholzgra Hartmut Holzgraefe
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: