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

APIv4 - Fix Activity contact virtual fields to work across joins #26374

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

colemanw
Copy link
Member

Overview

This fixes an oversight that slipped by the review process in #25744

Before

The new virtual fields for Activity.source/target/assignee_contact_id worked well when they were attached to the main entity but not when part of a join.

After

Fixed to work in any part of the query. Test updated.

Technical Details

Setting the column name to id means the sqlRenderer callback function will receive the correct alias for that field depending on which part of the query it is used in (it's not always a.id).
While I was in there I updated the test and consolidated the two tests in that file which were basically testing the same functionality.
I was also able to get rid of the "formatOutputForMultipleActivityContactIds" helper function because the API can automatically explode comma-separated values when serialization method is declared for the field.

FYI @highfalutin

@civibot
Copy link

civibot bot commented May 29, 2023

(Standard links)

@civibot civibot bot added the master label May 29, 2023
@eileenmcnaughton
Copy link
Contributor

Merging based on the unit test cover - this is really well tested code & the additional functionality is tested

@eileenmcnaughton eileenmcnaughton merged commit 9cf73ea into civicrm:master Jun 5, 2023
@eileenmcnaughton eileenmcnaughton deleted the activityVirtualFields branch June 5, 2023 07:23
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