Skip to content

Commit

Permalink
refs #42288, fixes priceset contribution export missing row(group by …
Browse files Browse the repository at this point in the history
…contact_id)
  • Loading branch information
jimyhuang committed Jan 14, 2025
1 parent e595f51 commit 474f04b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CRM/Contact/Form/Search/Custom/PriceSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu

protected $_eventID = NULL;

protected $_filled = NULL;

protected $_tableName = NULL;

public static $_primaryIDName = 'id';
Expand Down Expand Up @@ -263,6 +265,15 @@ function summary() {
return NULL;
}

function count(){
if(!$this->_filled){
$this->fillTable();
$this->_filled = TRUE;
}
$value = CRM_Core_DAO::singleValueQuery("SELECT count(*) FROM {$this->_tableName}");
return $value;
}

function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE
) {
Expand Down
13 changes: 13 additions & 0 deletions CRM/Contact/Form/Search/Custom/PriceSetContribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
require_once 'CRM/Contribute/PseudoConstant.php';
class CRM_Contact_Form_Search_Custom_PriceSetContribution extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {

public static $_primaryIDName = 'entity_id';

protected $_filled = NULL;

protected $_price_set_id = NULL;

protected $_tableName = NULL;
Expand Down Expand Up @@ -265,6 +269,15 @@ function summary() {
return NULL;
}

function count(){
if(!$this->_filled){
$this->fillTable();
$this->_filled = TRUE;
}
$value = CRM_Core_DAO::singleValueQuery("SELECT count(*) FROM {$this->_tableName}");
return $value;
}

function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE) {
$selectClause = "
contact_a.id as contact_id ,
Expand Down

0 comments on commit 474f04b

Please sign in to comment.