Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19768

CRM_Utils_Token::replace*Tokens() usage is inconsistent

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      CRM_Utils_Token::replaceGreetingTokens() operates by reference, modifying the first parameter. Other methods for token replacement in this class return the modified string.

      This leads to inconsistency in how these methods must be applied.

      There seem to be quite a few pass-by-reference parameters in this class which might not need to be pass-by-reference? (eg replaceContributionTokens() which passes by ref through a couple of functions to CRM_Utils_Array::retrieveValueRecursive(), but doesn't seem to be actually doing anything with that `&` ...

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              xurizaemon Chris Burgess
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: