Resolve dev/core#931 by not doing translation on the query if field exists during...
authorSeamus Lee <seamuslee001@gmail.com>
Thu, 2 May 2019 20:22:41 +0000 (06:22 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 2 May 2019 20:26:01 +0000 (06:26 +1000)
CRM/Upgrade/Incremental/Base.php

index 1ee17e37e8568bc7c8df863d7f0e2708831aa0e6..c787ca4ac2cd683ad702db5f2bf98948f5f4a328 100644 (file)
@@ -156,12 +156,12 @@ class CRM_Upgrade_Incremental_Base {
     $domain = new CRM_Core_DAO_Domain();
     $domain->find(TRUE);
     $queries = [];
-    if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists($table, $column)) {
+    if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists($table, $column, FALSE)) {
       if ($domain->locales) {
         if ($localizable) {
           $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
           foreach ($locales as $locale) {
-            if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists($table, "{$column}_{$locale}")) {
+            if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists($table, "{$column}_{$locale}", FALSE)) {
               $queries[] = "ALTER TABLE `$table` ADD COLUMN `{$column}_{$locale}` $properties";
             }
           }