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

Cleanup FinancialAccount BAO to use writeRecord and deprecate add #23079

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Apr 1, 2022

Overview

Cleanup the FinancialAccount BAO, consistent with other cleanups.

Technical Details

The thrust of this was to deprecate the add function in favor of writeRecord, but in the process I found and fixed several problems:

  • Defaults for boolean fields were being set in the BAO::add function instead of declared in the schema.
  • The default value for is_active was being set to 0. That's a bad default & we're trying to consistently set all is_active fields to default 1 across all entities.
  • There was a mismatch in the is_deductible field default value. It was set to default 1 in the schema, but that was overridden by the BAO for no apparent reason, which forced it to default 0. I've changed it to 0 in the schema for consistency with the status-quo.
  • Another inconsistency was that CRM_Core_PseudoConstant::flush() was being called after create/update but not after delete. I've fixed that via a post hook to handle all 3 operations.

@civibot
Copy link

civibot bot commented Apr 1, 2022

(Standard links)

@eileenmcnaughton
Copy link
Contributor

@MegaphoneJon did you see this?

@monishdeb
Copy link
Member

@monishdeb monishdeb merged commit 027db99 into civicrm:master Apr 4, 2022
@colemanw colemanw deleted the financialAccountCleanup branch April 4, 2022 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants