Skip to content

Commit

Permalink
Merge pull request #11209 from seamuslee001/CRM-21364-2
Browse files Browse the repository at this point in the history
CRM-21364 Fix upgrades from 4.2.x for ONLY_FULL_GROUP_BY compatability
  • Loading branch information
monishdeb authored Oct 31, 2017
2 parents c883e6d + d7c9a29 commit 1ee15be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions CRM/Upgrade/Incremental/php/FourThree.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ public function createFinancialRecords() {
(contribution_id, payment_instrument_id, currency, total_amount, net_amount, fee_amount, trxn_id, status_id, check_number,
to_financial_account_id, from_financial_account_id, trxn_date, payment_processor_id, is_fee)
SELECT con.id, ft.payment_instrument_id, ft.currency, ft.fee_amount, NULL, NULL, ft.trxn_id, %1 as status_id,
SELECT DISTINCT con.id, ft.payment_instrument_id, ft.currency, ft.fee_amount, NULL, NULL, ft.trxn_id, %1 as status_id,
ft.check_number, efaFT.financial_account_id as to_financial_account_id, CASE
WHEN efaPP.financial_account_id IS NOT NULL THEN
efaPP.financial_account_id
Expand All @@ -782,8 +782,7 @@ public function createFinancialRecords() {
AND efaPP.account_relationship = {$assetAccountIs})
LEFT JOIN {$tempTableName1} tpi
ON ft.payment_instrument_id = tpi.instrument_id
WHERE ft.fee_amount IS NOT NULL AND ft.fee_amount != 0 AND (con.contribution_status_id IN (%1, %3) OR (con.contribution_status_id =%2 AND con.is_pay_later = 1))
GROUP BY con.id";
WHERE ft.fee_amount IS NOT NULL AND ft.fee_amount != 0 AND (con.contribution_status_id IN (%1, %3) OR (con.contribution_status_id =%2 AND con.is_pay_later = 1))";
CRM_Core_DAO::executeQuery($sql, $queryParams);

//link financial_trxn to contribution
Expand Down
2 changes: 1 addition & 1 deletion CRM/Upgrade/Incremental/php/FourTwo.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public static function task_4_2_alpha1_convertContributions(CRM_Queue_TaskContex
LEFT JOIN civicrm_price_set_entity cpse on cpse.entity_table = 'civicrm_contribution_page' AND cpse.entity_id = cc.contribution_page_id
WHERE (cc.id BETWEEN %1 AND %2)
AND cli.entity_id IS NULL AND cc.contribution_page_id IS NOT NULL AND cpp.contribution_id IS NULL
GROUP BY cc.id
GROUP BY cc.id, cmp.membership_id
";
$result = CRM_Core_DAO::executeQuery($sql, $sqlParams);

Expand Down

0 comments on commit 1ee15be

Please sign in to comment.