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

Add workflow_name column to civicrm_msg_template, deprecate workflow_id #17227

Merged
merged 3 commits into from
May 8, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 4, 2020

Overview

Alternate to #17180

Some "Message Templates" are associated with workflow steps -- e.g. if a message template is associated with "membership_online_receipt", then it will be sent as the automated email after someone signs up for a membership online. This PR makes the association easier to work with.

Before

The relationship between "Message Template" and "Workflow" is tracked by the column civicrm_msg_template.workflow_id.

The column workflow_id is encoded in an unusual/confusing way -- it references civicrm_option_value.id. A column like this should normally reference civicrm_option_value.value or perhaps civicrm_option_value.name - but the COV ID is unusual and tricky to work with.

After

The relationship is also tracked by the columncivicrm_msg_template.workflow_name. This is a symbolic value referring to civicrm_option_value.name.

The workflow_id still works but is deprecated.

Technical Details

Alternate to #17180 per feedback from @mattwire & @totten

Comments

Note that this leaves open the question of adding an option group for this field as something we can do - but don't have to

@civibot
Copy link

civibot bot commented May 4, 2020

(Standard links)

@totten
Copy link
Member

totten commented May 7, 2020

Did some testing of the DB content with upgrades and new-installs. Looked good for upgrade and a normal (non-demo/non-example) installation. To support new installs with demo data, I rebased and ran regen.sh.

So far, light testing in the admin UI has been good, but I'm still trying out cases for runtime usage...

@totten
Copy link
Member

totten commented May 7, 2020

I did some testing with civivolunteer (an extension that defines a custom msgtpl with custom workflow) - and confirmed what we expected: (1) the workflow_name is filled on upgrade but (2) the workflow_name is faulty on new installs.

The extra commit 097c97a 0c5781a should keep the values in sync - I can confirm that new installations with civivolunteer end up with suitable workflow_name.

@totten
Copy link
Member

totten commented May 8, 2020

Discussed a bit on MM - Eileen seemed OK with the extra commits. Merging.

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.

2 participants