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

[REF] transform the setting of defaults in CustomField::create to be like (some) other entities #14671

Merged
merged 1 commit into from
Jul 1, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jun 28, 2019

Overview

Code cleanup only

Before

Less consistent / readable

After

More consistent / readable

Technical Details

This pattern (massaging the params & then copying) is more consistent. PR also moves creating the transaction to the start of the fn

I am cleaning up towards adding a bulk function that can be utilised by api v4 to create multiple fields with some efficiency on
sql statements (which matters when adding 2 or more fields to a large table)

Comments

@civibot
Copy link

civibot bot commented Jun 28, 2019

(Standard links)

@civibot civibot bot added the master label Jun 28, 2019
@eileenmcnaughton eileenmcnaughton changed the title [REF] transform the setting of defaults in CustomField::create to be … [REF] transform the setting of defaults in CustomField::create to be like (some) other entities Jun 28, 2019
@seamuslee001
Copy link
Contributor

@eileenmcnaughton can you rebase this please

@colemanw
Copy link
Member

@eileenmcnaughton what happened?

…like (some) other entities

This patter (massaging the params & then copying) is more consistent. PR also moves creating the transaction to the start of the fn

I am cleaning up towards adding a bulk function that can be utilised by api v4 to create multiple fields with some efficiency on
sql statements (which matters when adding 2 or more fields to a large table)
@eileenmcnaughton
Copy link
Contributor Author

I think I mis-pushed it to be empty & it auto-closed

@eileenmcnaughton
Copy link
Contributor Author

it's back!

@eileenmcnaughton
Copy link
Contributor Author

@colemanw passing now

//CRM-15792 - Custom field gets disabled if is_active not set
// this would ideally be a mysql default.
'is_active' => TRUE,
'is_view' => FALSE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't all of these be mysql defaults?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah beats me - but I wasn't going that far in this PR

@colemanw colemanw merged commit a74d4b4 into civicrm:master Jul 1, 2019
@colemanw colemanw deleted the cust_field branch July 1, 2019 11:16
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