From 8802d4267cbc50fa3dc23f9d31ffd743fd1619a0 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 30 Nov 2023 12:19:44 +1300 Subject: [PATCH] Use single quotes where double not required --- CRM/Contact/BAO/Query.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 84dc6eed97..6855885fdd 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -3213,27 +3213,28 @@ WHERE $smartGroupClause * * @throws \CRM_Core_Exception */ - public function tagSearch($values) { + public function tagSearch(array $values): void { [$name, $op, $value, $grouping, $wildcard] = $values; - $op = "LIKE"; + $op = 'LIKE'; $value = "%{$value}%"; $escapedValue = CRM_Utils_Type::escape("%{$value}%", 'String'); $useAllTagTypes = $this->getWhereValues('all_tag_types', $grouping); $tagTypesText = $this->getWhereValues('tag_types_text', $grouping); - $etTable = "`civicrm_entity_tag-" . uniqid() . "`"; - $tTable = "`civicrm_tag-" . uniqid() . "`"; - + $etTable = '`civicrm_entity_tag-' . uniqid() . '`'; + $tTable = '`civicrm_tag-' . uniqid() . '`'; + // All Tag Types will only be added as a field on the form if tags are available + // for entities other than contact if ($useAllTagTypes && $useAllTagTypes[2]) { $this->_tables[$etTable] = $this->_whereTables[$etTable] = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id) LEFT JOIN civicrm_tag {$tTable} ON ( {$etTable}.tag_id = {$tTable}.id )"; // search tag in cases - $etCaseTable = "`civicrm_entity_case_tag-" . uniqid() . "`"; - $tCaseTable = "`civicrm_case_tag-" . uniqid() . "`"; + $etCaseTable = '`civicrm_entity_case_tag-' . uniqid() . '`'; + $tCaseTable = '`civicrm_case_tag-' . uniqid() . '`'; $this->_tables[$etCaseTable] = $this->_whereTables[$etCaseTable] = " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id LEFT JOIN civicrm_case @@ -3242,8 +3243,8 @@ WHERE $smartGroupClause LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) LEFT JOIN civicrm_tag {$tCaseTable} ON ( {$etCaseTable}.tag_id = {$tCaseTable}.id )"; // search tag in activities - $etActTable = "`civicrm_entity_act_tag-" . uniqid() . "`"; - $tActTable = "`civicrm_act_tag-" . uniqid() . "`"; + $etActTable = '`civicrm_entity_act_tag-' . uniqid() . '`'; + $tActTable = '`civicrm_act_tag-' . uniqid() . '`'; $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); @@ -3260,8 +3261,8 @@ WHERE $smartGroupClause $this->_qill[$grouping][] = ts('Tag %1 %2', [1 => $tagTypesText[2], 2 => $op]) . ' ' . $value; } else { - $etTable = "`civicrm_entity_tag-" . uniqid() . "`"; - $tTable = "`civicrm_tag-" . uniqid() . "`"; + $etTable = '`civicrm_entity_tag-' . uniqid() . "`"; + $tTable = '`civicrm_tag-' . uniqid() . '`'; $this->_tables[$etTable] = $this->_whereTables[$etTable] = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id AND {$etTable}.entity_table = 'civicrm_contact' ) LEFT JOIN civicrm_tag {$tTable} ON ( {$etTable}.tag_id = {$tTable}.id ) "; -- 2.25.1