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

Fix 5.20 regression on retrieving template transaction with no logged in user #15976

Merged
merged 1 commit into from
Nov 28, 2019
Merged
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
3 changes: 3 additions & 0 deletions CRM/Contribute/BAO/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ public static function supportsFinancialTypeChange($id) {
*
* @return array
* @throws \CiviCRM_API3_Exception
* @throws \Civi\API\Exception\UnauthorizedException
*/
public static function getTemplateContribution($id, $overrides = []) {
// use api3 because api4 doesn't handle ContributionRecur yet...
Expand All @@ -435,6 +436,7 @@ public static function getTemplateContribution($id, $overrides = []) {
]);
// First look for new-style template contribution with is_template=1
$templateContributions = \Civi\Api4\Contribution::get()
->setCheckPermissions(FALSE)
->addWhere('contribution_recur_id', '=', $id)
->addWhere('is_template', '=', 1)
->addWhere('is_test', '=', $is_test)
Expand All @@ -444,6 +446,7 @@ public static function getTemplateContribution($id, $overrides = []) {
if (!$templateContributions->count()) {
// Fall back to old style template contributions
$templateContributions = \Civi\Api4\Contribution::get()
->setCheckPermissions(FALSE)
->addWhere('contribution_recur_id', '=', $id)
->addWhere('is_test', '=', $is_test)
->addOrderBy('id', 'DESC')
Expand Down