Deprecate meaningless parameter
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 2 Jan 2023 03:00:06 +0000 (16:00 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 11 Jan 2023 06:33:45 +0000 (19:33 +1300)
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Base.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php

index 6c275cdc07305fc6dc0e55934ce69213f19e1062..2ff571d5a26521a4c04c2d9c43b8520663c91a22 100644 (file)
@@ -69,10 +69,14 @@ class CRM_Contact_Form_Search_Custom_Base {
    * @param int $rowcount
    * @param null $sort
    * @param bool $returnSQL
+   *   Deprecated parameter
    *
    * @return string
    */
   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) {
+    if ($returnSQL) {
+      CRM_Core_Error::deprecatedWarning('do not pass returnSQL');
+    }
     $sql = $this->sql(
       'contact_a.id as contact_id',
       $offset,
@@ -80,12 +84,7 @@ class CRM_Contact_Form_Search_Custom_Base {
       $sort
     );
     $this->validateUserSQL($sql);
-
-    if ($returnSQL) {
-      return $sql;
-    }
-
-    return CRM_Core_DAO::composeQuery($sql);
+    return $sql;
   }
 
   /**
index 286819413797d45eb9377c950bc63a14f2127cd5..ae6eeec70cf2be1f72e3fcc8414144f7685ab871 100644 (file)
@@ -449,13 +449,7 @@ WHERE      t.table_name = 'Activity' AND
    */
   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) {
     $this->initialize();
-
-    if ($returnSQL) {
-      return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
-    }
-    else {
-      return CRM_Core_DAO::singleValueQuery("SELECT contact_id FROM {$this->tableName}");
-    }
+    return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
   }
 
   /**