Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21364 Fix upgrades from 4.2.x for ONLY_FULL_GROUP_BY compatability #11209

Merged
merged 1 commit into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if changing from the single group by to a distinct here will cause issues @JoeMurray @monishdeb thoughts?

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain this will have no major issues

";
$result = CRM_Core_DAO::executeQuery($sql, $sqlParams);

Expand Down