<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCache {
static $_alreadyLoaded = array();
/**
- * Check to see if we have cache entries for this group
- * if not, regenerate, else return
+ * Check to see if we have cache entries for this group.
+ *
+ * If not, regenerate, else return.
*
* @param $groupIDs
* Of group that we are checking against.
* the groupID to delete cache entries, NULL for all groups.
* @param bool $onceOnly
* run the function exactly once for all groups.
- *
- * @return void
*/
public static function remove($groupID = NULL, $onceOnly = TRUE) {
static $invoked = FALSE;
}
// grab a lock so other processes dont compete and do the same query
- $lockName = "civicrm.group.{$groupID}";
- $lock = new CRM_Core_Lock($lockName);
+ $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire("data.core.group.{$groupID}");
if (!$lock->isAcquired()) {
// this can cause inconsistent results since we dont know if the other process
// will fill up the cache before our calling routine needs it.
$customClass = CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID);
$searchSQL = $customClass->contactIDs();
$searchSQL = str_replace('ORDER BY contact_a.id ASC', '', $searchSQL);
+ if (!strstr($searchSQL, 'WHERE')) {
+ $searchSQL .= " WHERE ( 1 ) ";
+ }
$idName = 'contact_id';
}
else {