$elementCmpName = 'phone';
}
- if (in_array($elementCmpName, array_keys($addressCustomFields))) {
+ if (array_key_exists($elementCmpName, $addressCustomFields)) {
if ($cfID = CRM_Core_BAO_CustomField::getKeyID($elementCmpName)) {
$addressCustomFieldIds[$cfID][$name] = 1;
}
* @return string WHERE clause component for smart group criteria.
* @throws \CRM_Core_Exception
*/
- public function addGroupContactCache($groups, $tableAlias, $joinTable = "contact_a", $op, $joinColumn = 'id') {
+ public function addGroupContactCache($groups, $tableAlias, $joinTable, $op, $joinColumn = 'id') {
$isNullOp = (strpos($op, 'NULL') !== FALSE);
$groupsIds = $groups;
*/
public function modifiedDates($values) {
$this->_useDistinct = TRUE;
-
+ CRM_Core_Error::deprecatedWarning('function should not be reachable');
// CRM-11281, default to added date if not set
$fieldTitle = ts('Added Date');
$fieldName = 'created_date';
if (empty(self::$_defaultReturnProperties[$mode])) {
self::$_defaultReturnProperties[$mode] = [
- 'home_URL' => 1,
'image_URL' => 1,
'legal_identifier' => 1,
'external_identifier' => 1,
INNER JOIN $tableName transform_temp ON ( transform_temp.contact_id = displayRelType.contact_id_a OR transform_temp.contact_id = displayRelType.contact_id_b )
";
$qcache['where'] = "
-WHERE displayRelType.relationship_type_id = {$this->_displayRelationshipType}
+AND displayRelType.relationship_type_id = {$this->_displayRelationshipType}
AND displayRelType.is_active = 1
";
}
";
}
$qcache['where'] = "
-WHERE displayRelType.relationship_type_id = $relType
+AND displayRelType.relationship_type_id = $relType
AND displayRelType.is_active = 1
";
}
else {
$from .= $qcache['from'];
}
- $where = $qcache['where'];
+ if (!strlen($where)) {
+ $where = " WHERE 1 ";
+ }
+ $where .= $qcache['where'];
if (!empty($this->_tables['civicrm_case'])) {
// Change the join on CiviCRM case so that it joins on the right contac from the relationship.
$from = str_replace("ON civicrm_case_contact.contact_id = contact_a.id", "ON civicrm_case_contact.contact_id = transform_temp.contact_id", $from);
+ $where = str_replace("AND civicrm_case_contact.contact_id = contact_a.id", "AND civicrm_case_contact.contact_id = transform_temp.contact_id", $where);
$where .= " AND displayRelType.case_id = civicrm_case_contact.case_id ";
}
if (!empty($this->_permissionFromClause) && !stripos($from, 'aclContactCache')) {
$op,
$value,
$grouping,
- $daoName = NULL,
+ $daoName,
$field,
$label,
$dataType = 'String'
$value = $formValues[$element] ?? NULL;
if ($value) {
if (is_array($value)) {
- if (in_array($element, array_keys($changeNames))) {
+ if (array_key_exists($element, $changeNames)) {
unset($formValues[$element]);
$element = $changeNames[$element];
}