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

Update location tokens for Contact to new apiv4 style #25032

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Nov 23, 2022

Overview

Update location tokens for Contact to new apiv4 style

Traditionally we have supported a token format that reflects the Query object / apiv3. During our last round of work on tokens we migrated the 'adverstised' token names to apiv4 style, while keeping the old ones working as deprecated tokens.

For the Contact tokens the internal workings use apiv4 now but the advertised tokens are apiv3 style. In addition the apiv4 style tokens that are also supported differed from what has since been added to apiv4

  • Note 'advertised' refers to what is inserted if a selection from the dropdown is used (see screen shot after table)
Token Style e.g Is advertised before is advertised after works before works after
legacy /query object {contact.street_adddress} Yes No Yes Yes
abandoned style {contact.primary_address.street_adddress} No No Yes Yes
apiv4 style {contact.address_primary.street_adddress} No Yes No Yes

image

Before

After

image

Technical Details

Noting minor changes to the formatting of the legacy tokens

contact.on_hold goes from 0 to 'No'
contact.im_provider goes from a number to a label
contact.signature_html renders html-encoded in plain text mode

I think these are all obscure enough we shouldn't hit any issues (and the advertised ones do work)

Comments

@civibot
Copy link

civibot bot commented Nov 23, 2022

(Standard links)

@civibot civibot bot added the master label Nov 23, 2022
@eileenmcnaughton eileenmcnaughton force-pushed the tokens branch 2 times, most recently from 69496d3 to b66936b Compare November 23, 2022 01:23
@colemanw
Copy link
Member

Agree this is an improvement. I'm satisfied with the test coverage here. We ought to remove support for the "abandoned" style eventually.

@colemanw colemanw merged commit 1d5447a into civicrm:master Nov 23, 2022
@colemanw colemanw deleted the tokens branch November 23, 2022 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants