-
-
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
dev/core#3077 - CiviCase - Call hooks when creating relationships #22814
dev/core#3077 - CiviCase - Call hooks when creating relationships #22814
Conversation
(Standard links)
|
Looks fine to me @mattwire @demeritcowboy work for you? |
Works for me :-) |
One of the exact same things happens as in the previous attempt to use api: It crashes for org clients. I haven't tested further because I now expect all the same issues will come up. |
@demeritcowboy do you remember what issue or PR that happened before? |
I had linked to it in my comment on #22810 (comment) - it was #15030 |
0bd466e
to
a4fd3fd
Compare
In terms of whether it works or not this version works (note: the PR title/description is no longer accurate). I'll leave the r-tech discussion about add() to others - I would normally put merge-ready. |
Thanks for the |
Overview
Refactors creating relationships when opening a new case to use
APIv4(temporarily using the BAO method), which calls hooks.Before
No hooks called.
After
Api used, hooks called, code easier to read.Technical Details
The attempt to use APIv4 failed if the case client is an Organization, due to some extra (faulty?) validation & processing which happens at that layer. IMO that needs tests and fixing, but for now, this calls
BAO_Relationship::add()
directly.Comments
I stepped through the unit tests and confirmed that this function has good test coverage.