Merge pull request #20138 from eileenmcnaughton/load
[civicrm-core.git] / CRM / Contact / BAO / GroupContactCache.php
index 876b6dfd68557d146a2fa585e23cd1cb561ca6f2..5a624bf8017ffb19d6605b52e810c97576c60af7 100644 (file)
@@ -132,7 +132,6 @@ AND (
     // this function is expensive and should be sparingly used if groupIDs is empty
     if (empty($groupIDs)) {
       $groupIDClause = NULL;
-      $groupIDs = [];
     }
     else {
       if (!is_array($groupIDs)) {
@@ -162,27 +161,8 @@ AND (
 
     $dao = CRM_Core_DAO::executeQuery($query);
     $processGroupIDs = [];
-    $refreshGroupIDs = $groupIDs;
     while ($dao->fetch()) {
       $processGroupIDs[] = $dao->id;
-
-      // remove this id from refreshGroupIDs
-      foreach ($refreshGroupIDs as $idx => $gid) {
-        if ($gid == $dao->id) {
-          unset($refreshGroupIDs[$idx]);
-          break;
-        }
-      }
-    }
-
-    if (!empty($refreshGroupIDs)) {
-      $refreshGroupIDString = CRM_Core_DAO::escapeString(implode(', ', $refreshGroupIDs));
-      $query = "
-UPDATE civicrm_group g
-SET    g.cache_date = NOW()
-WHERE  g.id IN ( {$refreshGroupIDString} )
-";
-      CRM_Core_DAO::executeQuery($query);
     }
 
     if (empty($processGroupIDs)) {