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

OptionValue - Use DB defaults instead of setting them in BAO::add #17170

Merged
merged 1 commit into from
Apr 25, 2020

Conversation

colemanw
Copy link
Member

Overview

Relies on DB defaults instead of setting them manually in the BAO.

Before

Setting defaults in PHP.

After

Use defaults set in the DB.

Technical Details

Of the 4 defaults being set in the BAO, 3 already had db defaults; I added DEFAULT NULL for the last.

Comments

The DB default for is_active is 1 but the BAO was setting it to 0. IMO the db default is better.
Existing forms all set this explicitly so this change won't affect them.

Of the 4 defaults being set in the DAO, 3 already had db defaults; I added DEFAULT NULL for the last.
@civibot
Copy link

civibot bot commented Apr 25, 2020

(Standard links)

@civibot civibot bot added the master label Apr 25, 2020
@colemanw
Copy link
Member Author

@eileenmcnaughton this fixes the test failures in #17167

@eileenmcnaughton
Copy link
Contributor

Looks good to me - I note that this changes the default for is_active - but in a way that is consistent with other places (defaults to TRUE)

@eileenmcnaughton eileenmcnaughton merged commit 5bc4ec9 into civicrm:master Apr 25, 2020
@eileenmcnaughton eileenmcnaughton deleted the optionValueDefault branch April 25, 2020 23:24
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.

2 participants