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#107) Fix regression which prevents editing CiviCase configuration #12842

Merged
merged 5 commits into from
Sep 20, 2018

Conversation

totten
Copy link
Member

@totten totten commented Sep 19, 2018

Overview

For dev/core#107, PR #11998 improved the CiviCase configuration to allow setting a default assignee. The functionality depended on a DB update (inserting an option-group) -- but the DB update only applies to existing sites, not to new sites.

Before

  • During upgrade of sites <5.4.alpha1, the option-group is added
  • In new sites >=5.4.alpha , the option-group does not exist -- leading the screen to misbehave:

screen shot 2018-09-19 at 1 45 30 pm

After

  • During upgrade of sites <5.4.alpha1, the option-group is added.
  • During upgrade of sites <5.5.2, the option-group is again added. This catches recently created sites. For older sites (<5.4.alpha1), this means an extra call to addActivityDefaultAssigneeOptions(), but that function is written in a safe way.
  • In new sites >=5.5.2 , the option-group does exist -- allowing the screen to behave correctly.

screen shot 2018-09-19 at 1 47 25 pm

Technical Details

When changing the standard content of the DB, one must do two activities:

  • Add an upgrade step (CRM/Upgrade/Incremental/...)
  • Update the default data template (xml/templates/civicrm_data.tpl) and regenerate the data (bin/regen.sh produces sql/civicrm_generated.mysql)

CC @reneolivo @jitendrapurohit @colemanw

@reneolivo
Copy link
Contributor

@totten this is REALLY good to know, I was not aware that this was the workflow. It will be important to bear this approach in mind when implementing a similar solution and when reviewing it.

(@option_group_id_default_assignee, '{ts escape="sql"}None{/ts}', '1', 'NONE', NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_default_assignee, '{ts escape="sql"}By relationship to case client{/ts}', '2', 'BY_RELATIONSHIP', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_default_assignee, '{ts escape="sql"}Specific contact{/ts}', '3', 'SPECIFIC_CONTACT', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_default_assignee, '{ts escape="sql"}ser creating the case{/ts}', '4', 'USER_CREATING_THE_CASE', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

@totten aside from this typo it's all good from my testing

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Updated.

@seamuslee001
Copy link
Contributor

Test Fails are unrelated and related to test box environment, merging as per the tag

@seamuslee001 seamuslee001 merged commit 7d89bd7 into civicrm:5.5 Sep 20, 2018
@totten totten deleted the 5.5-asg-opt-group branch September 20, 2018 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants