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#731 Add upgrade routine to convert on_hold to an array for sites with #13731

Merged
merged 1 commit into from
Mar 2, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Feb 28, 2019

Overview

Adds an upgrade routine for smart groups affected by the change of field type for on_hold emails
where civimail_multiple_bulk_emails is enabled

Before

Smart groups need to be manually resaved

To replicate create a smart group for contacts with email on hold with the setting civimail_multiple_bulk_emails enabled on 5.8 codebase, then switch to 5.11 & create one - note the format differences ie email_on_hold is a string in the 5.8 group & an array in the 5.11 group

After

Upgrading to 5.11 updates the groups

Run the upgrade - both groups should be the same

Technical Details

For sites with civimail_multiple_bulk_emails set we get a select box which needs an array rather than a checkbox, the saved groups need to reflect that.

// preferred communication method
if (Civi::settings()->get('civimail_multiple_bulk_emails')) {
  ->addSelect('email_on_hold',
    array('entity' => 'email', 'multiple' => 'multiple', 'label' => ts('Email On Hold'), 'options' => CRM_Core_PseudoConstant::emailOnHoldOptions()));
}
else {
  ->add('advcheckbox', 'email_on_hold', ts('Email On Hold')

Comments

Note from my testing there is problem loading the defaults on an existing saved search due to the field name having a discrepancy
wrong - this aligns groups created before & after the 5.9 upgrade but does not resolve that.

@twomice ping

https://lab.civicrm.org/dev/core/issues/731

@civibot
Copy link

civibot bot commented Feb 28, 2019

(Standard links)

@civibot civibot bot added the 5.11 label Feb 28, 2019
@@ -75,6 +75,18 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
public function upgrade_5_11_alpha1($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
$this->addTask('Update smart groups where jcalendar fields have been converted to datepicker', 'updateSmartGroups', $rev);
if (Civi::settings()->get('civimail_multiple_bulk_emails')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton shouldn't this be in 5_11_beta1 as it is in the RC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seamuslee001 I guess - I can move it there if you think that is better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seamuslee001 ok updated

@eileenmcnaughton eileenmcnaughton changed the title Add upgrade routine to convert on_hold to an array for sites with dev/core#731 Add upgrade routine to convert on_hold to an array for sites with Feb 28, 2019
@eileenmcnaughton eileenmcnaughton force-pushed the 5.11 branch 3 times, most recently from 27e58bb to 5d7371c Compare February 28, 2019 23:59
civimail_multiple_bulk_emails set.

with that set we get a select box which needs an array rather than a checkbox.

Note from my testing there is problem loading the defaults due to the field name being
wrong - this aligns groups created before & after the 5.9 upgrade but does not resolve that.

    // preferred communication method
    if (Civi::settings()->get('civimail_multiple_bulk_emails')) {
      ->addSelect('email_on_hold',
        array('entity' => 'email', 'multiple' => 'multiple', 'label' => ts('Email On Hold'), 'options' => CRM_Core_PseudoConstant::emailOnHoldOptions()));
    }
    else {
      ->add('advcheckbox', 'email_on_hold', ts('Email On Hold')
@eileenmcnaughton
Copy link
Contributor Author

test this please

1 similar comment
@eileenmcnaughton
Copy link
Contributor Author

test this please

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor Author

test this please

@seamuslee001
Copy link
Contributor

This looks fine to me and is well covered by the tests adding merge on pass

@eileenmcnaughton
Copy link
Contributor Author

thanks @seamuslee001 - is it also your understanding that there is still an outstanding issue in the regression q even with this merged relating to changes to this field?

@eileenmcnaughton
Copy link
Contributor Author

unrelated fail

@eileenmcnaughton eileenmcnaughton merged commit 26dfced into civicrm:5.11 Mar 2, 2019
@eileenmcnaughton eileenmcnaughton deleted the 5.11 branch March 2, 2019 06:20
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.

2 participants