$this->buildSelectFields();
$this->buildWhereClause();
-
- if (in_array('count', $this->select)) {
+ if (in_array('count_rows', $this->select)) {
$this->query->select("count(*) as c");
}
else {
$result_dao = \CRM_Core_DAO::executeQuery($this->query->toSQL());
while ($result_dao->fetch()) {
- if (in_array('count', $this->select)) {
+ if (in_array('count_rows', $this->select)) {
$result_dao->free();
return (int) $result_dao->c;
}
$values[$key]['id'] = $item[$lowercase_entity . "_id"];
}
if (!empty($item['financial_type_id'])) {
- // 4.3 legacy handling - translate financial_type to contribution_type unless financial_type is explicitly specified.
- if (!is_array($params) || empty($params['return']) || !is_array($params['return']) ||
- (empty($params['return']['financial_type_id']) && !in_array('financial_type_id', $params['return'])) ||
- (!empty($params['return']['contribution_type_id']) || in_array('contribution_type_id', $params['return']))
- ) {
- $values[$key]['contribution_type_id'] = $item['financial_type_id'];
- }
+ // 4.3 legacy handling.
+ $values[$key]['contribution_type_id'] = $item['financial_type_id'];
}
if (!empty($item['next_sched_contribution_date'])) {
// 4.4 legacy handling
$query = new \Civi\API\Api3SelectQuery($entity, CRM_Utils_Array::value('check_permissions', $params, FALSE));
$query->where = $params;
if ($options['is_count']) {
- $query->select = array('count');
+ $query->select = array('count_rows');
}
else {
$query->select = array_keys(array_filter($options['return']));
//api has special handling on these 2 fields for backward compatibility reasons
$entity['contribution_type_id'] = $updateParams['financial_type_id'];
}
+ if (isset($updateParams['next_sched_contribution_date']) && in_array($entityName, array('ContributionRecur'))) {
+ //api has special handling on these 2 fields for backward compatibility reasons
+ $entity['next_sched_contribution'] = $updateParams['next_sched_contribution_date'];
+ }
$update = $this->callAPISuccess($entityName, 'create', $updateParams);
$checkParams = array(
//api has special handling on these 2 fields for backward compatibility reasons
$entity['contribution_type_id'] = $updateParams['financial_type_id'];
}
+ if (isset($updateParams['next_sched_contribution_date']) && in_array($entityName, array('ContributionRecur'))) {
+ //api has special handling on these 2 fields for backward compatibility reasons
+ $entity['next_sched_contribution'] = $updateParams['next_sched_contribution_date'];
+ }
}
}
$baoObj->free();