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

dev/core#370: No new tasks and documents get added to workflow #12748

Conversation

ajesamson
Copy link
Contributor

Overview

In civi case types, when all built-in tasks and documents are deleted from the Standard Timeline of a workflow, no new tasks and documents get saved to that workflow. This PR fixes the issue, ensuring new task can be added.

Before

case_type

After

case_type_after

Technical Details

After deleting all existing tasks, activityTypes becomes undefined. To fix the issue, it was ensured the property activityTypes exists on activitySet by initializing it with existing value or empty array.

activitySet.activityTypes = activitySet.activityTypes || [];

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented Aug 29, 2018

(Standard links)

@colemanw
Copy link
Member

@civicrm-builder add to whitelist

@seamuslee001
Copy link
Contributor

Jenkins re test this please

Copy link

@AkA84 AkA84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajesamson just a small note

@@ -355,7 +355,8 @@
}

function addActivityToSet(activitySet, activityTypeName) {
var activity = {
activitySet.activityTypes = activitySet.activityTypes || [];
var activity = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest this format

function addActivityToSet(activitySet, activityTypeName) {
  var activity;

  activitySet.activityTypes = activitySet.activityTypes || [];

  activity = { /* ... */ }
}

@mlutfy
Copy link
Member

mlutfy commented Aug 30, 2018

jenkins, test this please

@colemanw
Copy link
Member

This looks like the right fix to me. Verified the bug and confirmed the fix.

@colemanw colemanw merged commit 616d4c6 into civicrm:master Sep 21, 2018
@davialexandre davialexandre deleted the 370-no-new-tasks-and-documents-get-added-to-workflow branch October 23, 2018 16:37
davialexandre pushed a commit to compucorp/civicrm-core that referenced this pull request Oct 23, 2018
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.

6 participants