-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
APIv4 - CiviCase API: Fix openening a case with current user as creator #20238
Conversation
(Standard links)
|
Stacktrace /home/jenkins/bknix-dfl/build/core-20238-1pay5/web/sites/all/modules/civicrm/Civi/Api4/Generic/DAOUpdateAction.php:63 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r-run: it works!
The DAOActionTrait::writeObjects function was formatting values but not by reference, so the CiviCase writeObjects function was using unformatted values to open the case, which would contain the raw string `user_contact_id` instead of the processed value.
@colemanw it looks like this bug could have been affecting other entities too such as address? Would it only affect them when called via api4 or more genericly? |
It would only affect APIv4 calls, which are still few & far-between in core. I also don't think the bug affects other entities; reading the code I don't see others that do extra processing where the formatting matters. |
This seems mergeable & tested to me - added merge-ready in case @mattwire has any last comments |
Merging based on @eileenmcnaughton review. I just wanted to get clarification from @colemanw which he has done :-) |
Overview
Fixes APIv4 to be able to open a Case with the current user as creator.
Before
Passing
user_contact_id
as the case creator or case contact causes an error.After
Works.
Technical Details
The
DAOActionTrait::writeObjects
function was formatting values but not by reference, so the CiviCasewriteObjects
function was using unformatted values to open the case, which would contain the raw stringuser_contact_id
instead of the processed value.