-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Reconcile contribution amount tokens #21036
Conversation
(Standard links)
|
*/ | ||
public function evaluateToken(TokenRow $row, $entity, $field, $prefetch = NULL) { | ||
$actionSearchResult = $row->context['actionSearchResult']; | ||
$fieldValue = $actionSearchResult->{"contrib_$field"} ?? NULL; | ||
|
||
if (in_array($field, ['total_amount', 'fee_amount', 'net_amount'])) { | ||
if (array_key_exists($field, $this->getPseudoTokens())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just moved higher to process it first since there is no metadata for these tokens & it will enotice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- note I will switch in a follow up to having an isPseudoToken function
b13db4a
to
6519150
Compare
Follow up switch to use apiv4 metadata #21038 |
@eileenmcnaughton this is conflicted now but it does match what I was expecting |
6519150
to
646bf77
Compare
@seamuslee001 rebased |
This adds non_deductible_amount, as identified in civicrm#21034 It also moves the metadata functions to a parent class - this class might wind up being a temporary class as there are 3 other contenders for where this functionality should go - the TokenTrait, the abstractProvider or the tokenRow class. The intent is not to make that decision yet - just to provide visual clarity about what is generic Note - I've figured out how to switch over to v4 api for this but will do that in a separate PR
646bf77
to
17b6f17
Compare
Overview
Reconcile contribution amount tokens
Before
non_deductible_amount identified in #21034 as being present in the legacy token provider but not the token processor / scheduled reminders
After
Rendered & tested in both
Technical Details
PR also moves the metadata functions to a parent class - this class might wind up
being a temporary class as there are 3 other contenders for where this functionality
should go - the TokenTrait, the abstractProvider or the tokenRow class. The intent
is not to make that decision yet - just to provide visual clarity about
what is generic
Note - I've figured out how to switch over to v4 api for this but will do that in a separate PR
Comments