Closed MegaphoneJon closed 5 years ago
My last PR passes a $context
value to getTokenDetails()
. That's a very expensive call, especially if you have other extensions providing custom tokens. By passing the context, I can skip processing tokens in other extensions that I know aren't necessary here. It gives me a 10x speedup when using the Salutations extension!
That's correct, it's an arbitrary string.
Oh, good thinking. If this is the only change you have, I'll push that on this branch. Otherwise I'll wait until you've reviewed everything.
@MegaphoneJon sure, this is great otherwise. Default to 1 on that custom field, and we can merge.
@twomice updated!
Thanks - merged!
This PR allows a user to configure which relationship types should get tokens generated via the UI. I updated the README to document this and to remove this option from the "Room for Improvement" section.
Note that:
civix generate:upgrader
updatedreltokens.civix.php
and added a bunch of boilerplate.So this looks like a big PR, but the only code changes are:
CRM_Reltoken_Upgrader::addCustomData()
(creates the custom field)CRM_Reltoken_Upgrader::install()
andCRM_Reltoken_Upgrader::enable()
(which calladdCustomData()
;_reltoken_get_hashed_relationship_types()
to filter by the new custom field.