-
-
Notifications
You must be signed in to change notification settings - Fork 825
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/#133 Make Conditions Stricter When Checking If Reply-To Field Is Empty #12176
dev/core/#133 Make Conditions Stricter When Checking If Reply-To Field Is Empty #12176
Conversation
Can one of the admins verify this patch? |
test this please |
I think this is pretty compelling. My feeling is we should probably also only set it if id is empty though as we don't want to overwrite the reply_to if the subject is being updated by the api. I was going to merge on the basis this would be 'no worse' on that front but I'm not sure actually - it might expose more pathways to that 'bug' |
@eileenmcnaughton well I think this probably safe to merge on its own, we also need to take into account the situation say where you have updated the from email address so now the reply to also needs to be updated as well. |
@seamuslee001 how do we differentiate that though? It seems like setting the reply address from the from address would be always correct when there is no id & sometimes correct when there is an id and it's hard to know when, unless the calling function handles it. This change increases the cases in which the BAO would make a guess about what the calling function really intended. Perhaps we need to handle this defaulting at the form level not the BAO ? |
@eileenmcnaughton well its hard to tell i tend to think that empty is better than isset here in general, Interms of setting the reply to base on the from that isn't always the case either sometimes people will specifically set a separate reply to address compared to the from, I think form level maybe more sensible of course form level here = angular not Quickform / smarty |
@seamuslee001 I agree empty is better but changing at the BAO level has a risk of unintended consequences (although I think that risk is only on updates). |
@eileenmcnaughton |
I would be ok with
which would retain the existing behaviour on update but would be more aggressive on new. If we want to be more aggressive on update I think we should do that at the form layer |
…To Field Is Empty dev/core/civicrm#133 Retain existing behaviour on update and only be aggressive on adding new
5600aae
to
d3521e4
Compare
@eileenmcnaughton |
great - merging. For updates we should fix at the form level |
Overview
reply-to field is NULL in the following case
Technical Details
In CRM_Mailing_BAO_Mailing.php when adding a new mailing (add() method), there is a condition to check if 'reply-to' field is set and if it is not set, then 'from-email' is used.
here instead if using
if(!isset($params['replyto_email']))
we should use
if(empty($params['replyto_email']))
so that empty string like '' will also be considered and reply-to could not be NULL