Skip to content
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

CRM-20802 - CaseType - Flush any in-memory caches that might reference case-type #10591

Merged
merged 1 commit into from
Jul 1, 2017

Conversation

totten
Copy link
Member

@totten totten commented Jul 1, 2017

== Description

Suppose we're running this snippet:

addToTimeline('housing_support', array('name' => 'Case Task', 'reference_activity' => 'Open Case', 'reference_offset' => '9', 'reference_select' => 'newest'));
civicrm_api3('Case', 'create', array(...'housing_support'...));

function addToTimeline($caseType, $timelineEntry) {
  $caseType = civicrm_api3('CaseType', 'getsingle', array('name' => $caseType));

  foreach ($caseType['definition']['activitySets'] as &$actSet) {
    if ($actSet['name'] === 'standard_timeline') {
      $actSet['activityTypes'][] = $timelineEntry;
    }
  }

  civicrm_api3('CaseType', 'create', array(
    'id' => $caseType['id'],
    'definition' => $caseType['definition'],
  ));
}

== Before

The resulting Case record does not have the Case Task activity.

== After

The resulting Case record does have the Case Task activity.


totten added a commit to civicrm/civicrm-buildkit that referenced this pull request Jul 1, 2017
@colemanw colemanw merged commit 4c58a08 into civicrm:master Jul 1, 2017
@totten totten deleted the master-casetype-flush branch July 3, 2017 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants