-
-
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
dev/core#2650 Add support for names & labels for token pseudoconstants #20961
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Standard links)
|
eileenmcnaughton
force-pushed
the
status_name
branch
3 times, most recently
from
July 27, 2021 07:50
29ebaf4
to
046a056
Compare
eileenmcnaughton
force-pushed
the
status_name
branch
2 times, most recently
from
July 27, 2021 10:07
3706e67
to
313229e
Compare
dang - that test passes locally & I think it might fail when not in isolation - maybe caching ... |
eileenmcnaughton
force-pushed
the
status_name
branch
from
July 27, 2021 19:44
313229e
to
b82d27f
Compare
eileenmcnaughton
force-pushed
the
status_name
branch
from
July 27, 2021 22:58
7507c4f
to
963e217
Compare
This is per https://lab.civicrm.org/dev/core/-/issues/2650 - it - ensures that the 4 existing functions that deal with tokens handle tokens for the name and label for the (only) field that has had this treatment so far -contribution_status_id Hence both CRM_Core_SelecetValues::contributionTokens and CRM_Contribute_Tokens->tokenNames are tested to ensure they both return the same keys and labels for {contribution.contribution_status_id} {contribution.contribution_status_id:name} {contribution.contribution_status_id:label} And both rendering CRM_Contribute_Tokens via scheduled reminders and using CRM_Contribute_BAO_Contribution::replaceContributionTokens are tested to ensure they render them the same. In the context of this PR no existing tokens are altered or removed & there is only addition. However, the next step would be to remove the following token from {contribution.status}. Since there is no UI availability of this token it is likely unused - but that step would entail an upgrade script to remove it from the saved scheduled reminders. With those parts in place it should be possible to reconcile the remaining tokens, lock that parity in with tests and move on to exposing the contribution tokens to message templates. It would be nice to fully remove CRM_Contribute_BAO_Contribution::replaceContributionTokens or make it a wrapper for - however, I fear that might be quite challenging due to the way it's used with group bys & some pretty intense hackery.
eileenmcnaughton
force-pushed
the
status_name
branch
from
July 28, 2021 01:02
963e217
to
17cca51
Compare
|
I've put up this to remove the dead token from action_schedule while we still know it's only available from there #20978 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is per https://lab.civicrm.org/dev/core/-/issues/2650 - it adds variations on the token
{contribution.contribution_status_id}
which support names and labels, i.e.Both CRM_Core_SelecetValues::contributionTokens and CRM_Contribute_Tokens->tokenNames
are tested to ensure they return the same keys and labels for each.
And both rendering CRM_Contribute_Tokens via scheduled reminders and
using CRM_Contribute_BAO_Contribution::replaceContributionTokens are tested to ensure
they render them the same.
Before
The contribution token processor and legacy contributions use different syntaxes around tokens with potential labels or names and there is no clear plan as to what to standardise on. Also, some of the message templates work pretty hard to get around NOT having
{contribution.contribution_status_id:name}
availableAfter
available & consistent in all 4 code places that refer to contribution tokens at the moment
Technical Details
In the context of this PR no existing tokens are altered or removed & there is
only addition. However, the next step would be to remove the following token
from {contribution.status}. Since there is no UI availability
of this token it is likely unused - but that step would entail an upgrade
script to remove it from the saved scheduled reminders.
With those parts in place it should be possible to reconcile the remaining tokens,
lock that parity in with tests and move on to exposing the contribution tokens
to message templates.
It would be nice to fully remove CRM_Contribute_BAO_Contribution::replaceContributionTokens
or make it a wrapper for - however, I fear that might be quite
challenging due to the way it's used with group bys & some pretty intense hackery.
Comments