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: When using the Donor Wall shortcode or block, filtering by only_comments returns no donations #7582

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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: 3 additions & 2 deletions includes/donors/class-give-donor-wall.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ private function get_donation_data( $atts = [] ) {
/**
* Get donation list for specific query
*
* @unreleased fix - filter by only_comments attr
* @since 2.3.0
*
* @param array $atts
Expand Down Expand Up @@ -479,8 +480,8 @@ private function get_donations( $atts = [] ) {

// exclude donations which does not has donor comment.
if ( $query_params['only_comments'] ) {
$sql .= " INNER JOIN {$wpdb->give_comments} as gc1 ON (p1.ID = gc1.comment_parent)";
$where .= " AND gc1.comment_type='donor_donation'";
$sql .= " INNER JOIN {$wpdb->donationmeta} as m4 ON (p1.ID = m4.{$donation_id_col})";
$where .= " AND m4.meta_key='_give_donation_comment'";
}

// exclude anonymous donation form query based on query parameters.
Expand Down
Loading