dev/core#2516 Invalidate only smart groups - is smart group or has children
authorscardinius <scardinius@chords.pl>
Wed, 14 Apr 2021 08:15:03 +0000 (10:15 +0200)
committerscardinius <scardinius@chords.pl>
Wed, 14 Apr 2021 08:15:03 +0000 (10:15 +0200)
CRM/Contact/BAO/GroupContactCache.php

index f8f45dbe83448d8cb4797b7ee323684a04694a02..876b6dfd68557d146a2fa585e23cd1cb561ca6f2 100644 (file)
@@ -578,7 +578,7 @@ ORDER BY   gc.contact_id, g.children
   public static function invalidateGroupContactCache($groupID) {
     CRM_Core_DAO::executeQuery("UPDATE civicrm_group
       SET cache_date = NULL
-      WHERE id = %1 AND saved_search_id IS NOT NULL", [
+      WHERE id = %1 AND (saved_search_id IS NOT NULL OR children IS NOT NULL)", [
         1 => [$groupID, 'Positive'],
       ]);
   }