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 - add is_current as a pseudo (calculated) field #20586

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

colemanw
Copy link
Member

Overview

Adds an "is_current" field to SearchKit for relationships, events & campaigns. It checks that the record is active and has a non-past end date and a non-future start date.

Technical Details

This adds the first calculated field to APIv4. It works by injecting a SQL function and aliasing it with the name of the fake field. This approach allows it to work as part of the WHERE clause as well as the SELECT clause, even across joins.

Marking the old "is_current" api param deprecated because the field works better.

@civibot
Copy link

civibot bot commented Jun 13, 2021

(Standard links)

@civibot civibot bot added the master label Jun 13, 2021
@seamuslee001
Copy link
Contributor

@colemanw can you rebase?

This adds the first calculated field to APIv4. It works by injecting a SQL function and aliasing it
with the name of the fake field. This approach allows it to work as part of the WHERE clause
as well as the SELECT clause, even across joins.

Marking the old "is_current" api param deprecated because the field works better.
@seamuslee001
Copy link
Contributor

This looks good to me and makes sense to me UTs should give us good enough cover here

@seamuslee001 seamuslee001 merged commit 06d4b78 into civicrm:master Jul 2, 2021
@seamuslee001 seamuslee001 deleted the is_current branch July 2, 2021 01:37
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