CRM-12638 only rebuild alpha pager when needed
[civicrm-core.git] / CRM / Contact / Form / Search / Basic.php
index 88d3bae453415ddb968b6057474c96b722859fdc..e18eea976eda4cfc0bcaf5fe8814679637bf3f4f 100644 (file)
@@ -193,9 +193,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search {
     // we dont want to store the sortByCharacter in the formValue, it is more like
     // a filter on the result set
     // this filter is reset if we click on the search button
-    if ($this->_sortByCharacter !== NULL
-      && empty($_POST)
-    ) {
+    if ($this->_sortByCharacter !== NULL && empty($_POST)) {
       if (strtolower($this->_sortByCharacter) == 'all') {
         $this->_formValues['sortByCharacter'] = NULL;
       }
@@ -203,6 +201,9 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search {
         $this->_formValues['sortByCharacter'] = $this->_sortByCharacter;
       }
     }
+    else {
+      $this->_sortByCharacter = NULL;
+    }
 
     $this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
     $this->_returnProperties = &$this->returnProperties();