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

EntityRef - standardize on PascalCase for entity name and fix minor bug #13631

Merged
merged 3 commits into from
Feb 18, 2019

Conversation

colemanw
Copy link
Member

Overview

Just some cleanup related to EntityRef fields.

Before

EntityRef fields could theoretically accept snake_case or camelCase for the entity name, but they were not very internally consistent and might break with some compound words.

After

Standardize entityRef fields to always use the PascalCase version of the entity. Still accept other formats for legacy reasons.

Technical Details

Also includes a minor bugfix - option lists were not being cached in the entityRef filters, so ajax calls to api.getoptions were being made more often than necessary.

The filters objects were getting cloned instead of passed by reference,
which prevented loadEntityRefFilterOptions() from saving the list for reuse.
Although entityRef fields accept either snake_case or CamelCase, let's be consistent.
@civibot
Copy link

civibot bot commented Feb 18, 2019

(Standard links)

@civibot civibot bot added the master label Feb 18, 2019
@colemanw
Copy link
Member Author

@eileenmcnaughton this is the exciting conclusion to the EntityRef trilogy.

@eileenmcnaughton
Copy link
Contributor

Ok this makes sense - I tested a couple of fields & they still work! I tried switching one back to lcase & it still works - good to go IMHO

@eileenmcnaughton eileenmcnaughton merged commit b1b59a9 into civicrm:master Feb 18, 2019
@eileenmcnaughton eileenmcnaughton deleted the entityRefs3 branch February 18, 2019 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants