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

Fix returnProperties on contact retrieval in Contact_Tokens to fetch less, less often #24315

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Reduces DB lookups when rendering tokens

Before

When a token is not found a db lookup is done to get all tokens in use. Even when prefix_id is found prefix_id:label is not.

After

  • The code checks the base field (eg. prefix) before looking up the pseudoconstant
  • The fields retrieved filters out any already-present fields

Technical Details

Deprecated tokens like email_greeting are still driving unnecessary lookups - but I'm gonna remove them from the core templates & put in the preferred token rather than worry about fixing performance for deprecated tokens

Comments

@civibot
Copy link

civibot bot commented Aug 19, 2022

(Standard links)

@seamuslee001
Copy link
Contributor

Our tests should be good enough to cover this here

@seamuslee001 seamuslee001 merged commit c9fafc9 into civicrm:master Aug 22, 2022
@seamuslee001 seamuslee001 deleted the cont_tokens_less branch August 22, 2022 01:57
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