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

only check batch currency match when adding a financial_trxn #23741

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

ufundo
Copy link
Contributor

@ufundo ufundo commented Jun 9, 2022

Overview

Fix for regression(?) on Gift Aid extension https://lab.civicrm.org/extensions/ukgiftaid/-/issues/30 resulting from #20884 .

Before

The check for currency match looks up a financial_trxn using the entity_id parameter. But this is only a financial_trxn_id in the case where entity_table is adding financial transactions to the batch.

This leads to errors when batching contributions (e.g. https://lab.civicrm.org/extensions/ukgiftaid/-/issues/30#note_75292 ) and I imagine memberships too.

After

Only checks the currency matches when adding a financial_trxn.

Comments

I'm not sure whether it makes sense to write a separate check that works for checking contribution currencies. For other entities that can be batched (memberships?) I don't think it would make any sense, but I'm not really sure how these are used.

@civibot
Copy link

civibot bot commented Jun 9, 2022

(Standard links)

@MegaphoneJon
Copy link
Contributor

@ufundo this seems fine to me - but as the comment on the line above notes, the SyntaxConformanceTest doesn't like this, hence the failed test. You'll need to account for it, unfortunately.

@ufundo ufundo force-pushed the entitybatchcurrency branch from 258f22e to efe20e3 Compare June 9, 2022 19:09
@ufundo
Copy link
Contributor Author

ufundo commented Jun 10, 2022

Ah, I see - think I have it now!

@mattwire mattwire merged commit 10908e7 into civicrm:master Jun 13, 2022
@totten
Copy link
Member

totten commented Jun 14, 2022

@ufundo - @eileenmcnaughton suggested that this might be worth backporting to 5.51-rc and 5.50-stable. What do you think?

@ufundo
Copy link
Contributor Author

ufundo commented Jun 14, 2022

I think that would be great and don't see any conflicts.

I'm not totally sure of the process sorry? Should I open a PR against the 5.50/5.51 branches?

@totten
Copy link
Member

totten commented Jun 14, 2022

@ufundo Yep, PRs for 5.51 and 5.50 would be perfect.

@ufundo
Copy link
Contributor Author

ufundo commented Jun 14, 2022

#23788 and #23787 👍

@ufundo ufundo deleted the entitybatchcurrency branch June 14, 2022 14:56
@totten
Copy link
Member

totten commented Jun 14, 2022

Thanks @ufundo. It'll go out with in 5.50.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants