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

Perform contact searches (only) one time

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.7
    • Fix Version/s: Unscheduled
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      On current trunk revision 37348.

      Both CRM_Contact_Form_Search::preProcess and ::postProcess create their own instances of the customSelector class which in turn executes the search query based on slightly different parameters. I believe the difference in these parameters to be (likely) a bug that was not caught due to this redundancy; the second search was the only one whose results were seen. Additionally in the special case of the full-text searcher, a third set of search queries are made because the selectors created by the parent class are not persisted to class variables and made available for future use.

      This patch persists the first selector and references it in the other two locations that reference it for significant savings when search queries are expensive.

        Attachments

        1. double_search.diff
          7 kB
          Graylin Kim
        2. double_search.diff
          25 kB
          Graylin Kim

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shadesofgraylin Graylin Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified