Skip to content
Snippets Groups Projects
Commit 55488e61 authored by lobo's avatar lobo
Browse files

CRM-12341 - use wildcards only as suffix

----------------------------------------
* CRM-12341: prev/next cache should not do double-ended wildcard search
  http://issues.civicrm.org/jira/browse/CRM-12341
parent 61e03291
Branches
Tags
No related merge requests found
......@@ -314,7 +314,7 @@ AND (entity_id1 = %2 OR entity_id2 = %2)
if ($action == 'select') {
$whereClause .= "AND is_selected = 0";
$sql = "UPDATE civicrm_prevnext_cache SET is_selected = 1 {$whereClause} {$entity_whereClause}";
$params[1] = array("%{$cacheKey}%", 'String');
$params[1] = array("{$cacheKey}%", 'String');
}
elseif ($action == 'unselect') {
$whereClause .= "AND is_selected = 1";
......@@ -330,7 +330,7 @@ SET is_selected = 0
WHERE cacheKey LIKE %1 AND is_selected = 1
{$entity_whereClause}
";
$params[1] = array("%{$cacheKey}%", 'String');
$params[1] = array("{$cacheKey}%", 'String');
}
CRM_Core_DAO::executeQuery($sql, $params);
}
......@@ -360,7 +360,7 @@ WHERE cacheKey LIKE %1
$entity_whereClause
ORDER BY id
";
$params[1] = array("%{$cacheKey}%", 'String');
$params[1] = array("{$cacheKey}%", 'String');
$contactIds = array($cacheKey => array());
$cIdDao = CRM_Core_DAO::executeQuery($sql, $params);
......@@ -383,8 +383,8 @@ WHERE cacheKey LIKE %1
AND is_selected=1
AND cacheKey NOT LIKE %2
";
$params1[1] = array("%{$cacheKey}%", 'String');
$params1[2] = array("%{$cacheKey}_alphabet%", 'String');
$params1[1] = array("{$cacheKey}%", 'String');
$params1[2] = array("{$cacheKey}_alphabet%", 'String');
$dao = CRM_Core_DAO::executeQuery($query, $params1);
$val = array( );
......@@ -415,8 +415,8 @@ WHERE cacheKey LIKE %1
AND is_selected = 1
AND cacheKey NOT LIKE %2
";
$params1[1] = array("%{$cacheKey}%", 'String');
$params1[2] = array("%{$cacheKey}_alphabet%", 'String');
$params1[1] = array("{$cacheKey}%", 'String');
$params1[2] = array("{$cacheKey}_alphabet%", 'String');
$paramsTotal = CRM_Core_DAO::singleValueQuery($query, $params1);
$params['total'] = $paramsTotal;
$obj->_pager = new CRM_Utils_Pager($params);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment