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

Activity API won't update case-related activities due to bad validation

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2.2
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      The activity API can (and should) be able to update case-related activities. The problem is the _civicrm_activity_check_params() function, which gets confused when the activity is part of a case. Bypass the validator, and civicrm_activity_update works just fine.

      I would volunteer to fix it, but that check_params function is just too messy for me to understand. I have tried reading it several times and really cannot understand what the author was trying to achieve or why it had to be so convoluted.

      I guess my solution would be to just re-write the thing. I wrote a really clean and slick (IMHO) validator function for the new case API, which could serve as a good starting point for this (or any) $param validation.

        Attachments

          Activity

            People

            • Assignee:
              sunny.sharma Sunny Sharma
              Reporter:
              colemanw Coleman Watts
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 hours
                3h
                Remaining:
                Remaining Estimate - 3 hours
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified