-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Refactor CRM_Contact_BAO_Relationship::add to autoload missing params from existing record #15103
Conversation
(Standard links)
|
Thanks @mattwire - have taken a quick look and looks good so far. Give me a bit and I'll do a bit more. |
@mattwire I'd rather only do the load if we are missing specific params we need for the next processing steps - this could be part of a big batch update. |
2113ce0
to
94f43dd
Compare
… from existing record
2d614ea
to
5028849
Compare
@eileenmcnaughton Ok I've done that |
test this please |
This seems ok to me - will see if @demeritcowboy has further comments |
|
See test at #15121 |
I didn't like that there was a hardcoded ID there - but resisted the urge to fix because I couldn't find a an existing example and.. more PRs.. but as it's actually broken on your site here's a PR: #15123 |
Thanks @mattwire. While I've always been a huge fan of the number 6 it's time for it to go. It's the wrong id on dmaster too and any stock new install. |
Overview
This is a pre-requisite to #15030. The BAO add method needed updating so it loads missing parameters directly using standard methods rather than requiring that they are all passed in to the function.
Before
Have to pass a lot of parameters to the
CRM_Relationship_BAO_Relationship::add()
function. Existing parameters not found by the function.After
Per other standard functions,
add()
uses standard methods to find an existing record and use the params directly. This only happens if an ID is passed into the function.Technical Details
Use standard DAO find() method.
Comments