-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Toward CRM-19751: conditionally change On-Hold criteria to select on … #12942
Toward CRM-19751: conditionally change On-Hold criteria to select on … #12942
Conversation
(Standard links)
|
9be8641
to
eb4c6fc
Compare
e9da980
to
9359005
Compare
I've removed the WIP prefix, as this PR now has unit tests is ready for review. |
This is ready to be merged from my perspective. I was able to replicate this issue on a demo site, then I tested this pr by doing the following:
I tested searching using all three options (No, On Hold Bounce, On Hold Opt Out) as well as without the field populated and searching filters appropriately. |
Thanks @alifrumin ! I guess you'd be fine with me pinging @eileenmcnaughton asking to merge. |
@alifrumin you are a star! Really appreciate all the reviewing you have been doing. There is one thing I think we need to test before merging
Potentially the above could be done with it unchecked too but I think that is actually meaningless as it would just be ignored |
Also @alifrumin if you do think something should be merged please ping me - I can happily prioritise your pings based on all the review you have been doing |
Thank you @eileenmcnaughton. Good catch! I was not thinking about how this would effect existing smart groups. I followed Eileen's instructions above:
This pr makes it possible to make new smart groups that include contacts having emails set to "on hold - opt out" (by searching using the new select). This pr does not fix existing smart groups that are looking for "on hold = 1", nor does it break these smart groups more than they were already broken. Seems like progress but @eileenmcnaughton I will leave it to you if you think dealing with existing smart groups should be dealt with before merging or if that could be a separate issue. |
@alifrumin so do we have 4 scenarios here
|
After thinking thru these scenarios, I think it makes sense for the Email On Hold field on the advanced search form to always be a select. |
@alifrumin I agree with ", I think it makes sense for the Email On Hold field on the advanced search form to always be a select." - @twomice what do you think? |
From the UX viewpoint, I agree. Implementation seems tricky, though. The select list is driven by a method that returns an array with certain labels. We'd need that array to differ -- both in length and in the labels -- depending on the value of the "multiple bulk email address" setting, e.g.: "multiple bulk email address" = yes:
"multiple bulk email address" = no:
Now our neat little method isn't so neat anymore. Checkbox allows us to sidestep that issue. |
@twomice I'm having a lot of trouble processing this today - partly because of other meta distractions - on reading the above do you think there is a problem for sites with existing smart groups? I've having thought through that question you & @alifrumin think this should be merged I'm happy to merge it. |
I think this moves things forward without breaking things further than they have already been broken, but I could see it causing confusion for a small number of people @twomice maybe we could add a note to the "Enable multiple bulk email address for a contact" setting field that says something along the lines of "Enabling this setting will change the options for the Email on Hold field" and a note to the screen you see when you complete an upgrade to update any existing smart groups if you have this setting enabled? |
@alifrumin I agree with the spirit of your comment: "moves things forward without breaking things further than they have already been broken". I'm also concerned with the potential "confusion for a small number of people". I like the idea of adding some kind of explanation for the parts that are essentially "still broken" WRT smart groups. Which leads me to wonder -- and I admit I haven't looked at this and that maybe I'm the person who should, but in any case -- do you happen to know if/how a user can update an existing smart group so that it will work "as expected" with this change? I mean, is it as simple as editing smart group critiera and re-saving the group? If so, I think we can be content with letting people know they might need to do that, and solve that problem as a separate issue. |
In response to "do you happen to know if/how a user can update an existing smart group so that it will work "as expected" with this change? I mean, is it as simple as editing smart group criteria and re-saving the group?" -- short answer yes see details below (I tested this on the jenkins build. IF you have a smart group with the criteria email on hold =1 (that you create before enabling the setting with the checkbox) THEN if you enable the setting and go to edit the smart group the email on hold field shows as a select with no default see screenshot below: From there you can edit the smart group criteria (using the select box for Email On Hold) and resave the group and it works as expected. |
Great, thanks Ali. In this case, I think it would be good to take the "fix and warn" approach, basically what you suggested; that is, I would add these things to this PR:
If you're okay with that, I can add that to the PR, and we can tell Eileen we think it's good to merge. Sound good? |
Perfect @twomice. I will also put something in the release notes about it |
@alifrumin we cut 5.8 yesterday - if it's too much of a nightmare for you to manage the release notes part for a release that won't be cut for a month I would be OK to merge this to the rc if we tidy it up pretty quickly |
We haven’t started the release notes for 5.8 yet So it won’t be an issue for release notes. |
@alifrumin If we merge this now it will go into 5.9 - I'll proceed with that though on the assumption you'll still remember it by the time we cut that rc |
@twomice was there a last change on you here? |
f6ef2e1
to
d00f768
Compare
Yep, that was on me. Done now, fingers crossed. |
Jenkins test this please. |
Tests passing, yay! @eileenmcnaughton I think this is ready for merge now, or at least for your review towards that end. Thanks! |
@@ -36,6 +36,86 @@ | |||
*/ | |||
class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences { | |||
|
|||
public function preProcess() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twomice I think the changes to this form are not related to your PR but are merge mess?
We have removed this chunk of code from core (ideally we would also remove the rest of the form & jut use the Generic form but we'd need to move those post actions to metadata per the todo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang it, I though I had it this time. Trying again...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's removed @eileenmcnaughton . I'll ping again when jenkins tests are done. Thanks!
…Advanced Search form.
d00f768
to
38056b3
Compare
@twomice I've given the code a last look over & nothing else seems amiss so I think we can merge once tests pass. Thank you & also @alifrumin for persevering with this one as it took some effort |
@eileenmcnaughton thank you for persevering on this as well :) |
Fantastic. Thanks Ali for the reviews, and Eileen for patient mentoring on PR management. |
…Advanced Search form.
Overview
The issue CRM-19751 notes that Advanced Search criteria "email on hold" doesn't find emails with the "on hold opt-out" setting (which is only available when the CiviMail component setting "Enable multiple bulk email address for a contact" is enabled.
To fix this, we need the form to offer a set of options for this criteria, not just a checkbox.
PR #12883 addressed an underlying issue in the XML/SQL schema. Following onto that, the PR provided here makes the actual changes to the form.
Before
The "Email On Hold" criteria is a checkbox.
This allows searching for contacts having an email address with
on_hold
= 1, which equates to "on hold" when the "Enable multiple bulk email address for a contact" setting is disabled, and equates to "on hold - bounce" when the setting is enabled. There's no way to search for contacts having emails set to "on hold - opt out" (which is only available when this setting is enabled).After
The "Email On Hold" criteria is still a checkbox when the "Enable multiple bulk email address for a contact" setting is disabled, so it still works as it did before in that state.
This still allows searching for contacts having an email address with
on_hold
= 1, which equates to "on hold" when the "Enable multiple bulk email address for a contact" setting is disabled, and equates to "on hold - bounce" when the setting is enabled.On the other hand, when the "Enable multiple bulk email address for a contact" setting is enabled, the "Email On Hold" criteria is a multi-select, allowing to search on any of the three possible values for an email "on hold" property.
Technical Details
Comments
Needs tests.