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

Contribution types starting with lower case letters create API error

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.2.0
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      Having a contribution type starting with a lower case letter, CRM_Contribute_PseudoConstant::contributionType () returns all contribution types with lowercase letters. However, the API checks the contributiontype with an "ucfirst ( $value )" (line 320 of api/v3/Contribution.php):

      $contributionTypeId = CRM_Utils_Array::key ( ucfirst ( $value ), CRM_Contribute_PseudoConstant::contributionType () );

      This results in a NULL, and any contribution updates will fail with "Invalid Contribution Type".

      Eigther, ucfirst should be removed, or all contribution types should be converted to ucfirst, too.

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              prolineserver Holger Motzkau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: