APIv4 - Add backticks around fields in join criteria
authorColeman Watts <coleman@civicrm.org>
Fri, 12 Nov 2021 02:42:36 +0000 (21:42 -0500)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 12 Nov 2021 04:48:46 +0000 (17:48 +1300)
Fixes dev/mail#103

Civi/Api4/Service/Schema/Joinable/Joinable.php

index 2681466d86fa2eed2f86ab00d32cdc03ad6f6cf8..6b5aed9e8242c073b0ac369e1d1aa70ad1a857fa 100644 (file)
@@ -104,7 +104,7 @@ class Joinable {
    */
   public function getConditionsForJoin(string $baseTableAlias, string $tableAlias) {
     $baseCondition = sprintf(
-      '%s.%s =  %s.%s',
+      '`%s`.`%s` =  `%s`.`%s`',
       $baseTableAlias,
       $this->baseColumn,
       $tableAlias,