Skip to content

Commit

Permalink
Attempt to fix upgrade error on multilingual installs
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 committed Jun 23, 2016
1 parent bfb27e0 commit 303a24f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions CRM/Upgrade/Incremental/php/FourSeven.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,24 +623,24 @@ public function addHelpPreAndHelpPostFieldsPriceFieldValue(CRM_Queue_TaskContext
if ($domain->locales) {
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
foreach ($locales as $locale) {
if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_price_field_value', 'help_pre_' . $locale)) {
CRM_Core_DAO::executeQuery('ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_pre_' . $locale . '` text COLLATE utf8_unicode_ci COMMENT "Price field option pre help text."');
if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_price_field_value', "help_pre_{$locale}")) {
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_pre_{$locale}` text COLLATE utf8_unicode_ci COMMENT 'Price field option pre help text.'");
}
if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_price_field_value', 'help_post_' . $locale)) {
CRM_Core_DAO::executeQuery('ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_post_' . $locale . '` text COLLATE utf8_unicode_ci COMMENT "Price field option post help text."');
if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_price_field_value', "help_post_{$locale}")) {
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_post_{$locale}` text COLLATE utf8_unicode_ci COMMENT 'Price field option post help text.'");
}
}
}
else {
if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_price_field_value', 'help_pre')) {
CRM_Core_DAO::executeQuery('ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_pre` text COLLATE utf8_unicode_ci COMMENT "Price field option pre help text."');
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_pre` text COLLATE utf8_unicode_ci COMMENT 'Price field option pre help text.'");
}
if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_price_field_value', 'help_post')) {
CRM_Core_DAO::executeQuery('ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_post` text COLLATE utf8_unicode_ci COMMENT "Price field option post help text."');
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_price_field_value`
ADD COLUMN `help_post` text COLLATE utf8_unicode_ci COMMENT 'Price field option post help text.'");
}
}
return TRUE;
Expand Down

0 comments on commit 303a24f

Please sign in to comment.