Skip to content
Snippets Groups Projects
Commit a0552fd5 authored by Eileen McNaughton's avatar Eileen McNaughton
Browse files

rc#14 handle api calls post schema change

parent db0aaf74
No related branches found
No related tags found
No related merge requests found
......@@ -2059,6 +2059,10 @@ function _civicrm_api3_swap_out_aliases(&$apiRequest, $fields) {
*/
function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $entity) {
list($fieldValue, $op) = _civicrm_api3_field_value_check($params, $fieldName);
if ($fieldName === 'auto_renew' && $fieldValue === TRUE) {
// https://lab.civicrm.org/dev/rc/-/issues/14
$fieldValue = 1;
}
if (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) {
return;
}
......
......@@ -184,6 +184,24 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
]);
}
/**
* Test that auto renew = TRUE still works post schema change.
*
* https://lab.civicrm.org/dev/rc/-/issues/14
*/
public function testCreateMembershipTypeAutoRenewBool(): void {
$this->callAPISuccess('MembershipType', 'create', [
'member_of_contact_id' => 1,
'financial_type_id' => 'Member Dues',
'duration_unit' => 'year',
'duration_interval' => 1,
'period_type' => 'rolling',
'minimum_fee' => 1,
'name' => 'gen',
'auto_renew' => TRUE,
]);
}
/**
* Test update.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment