Regression Analysis from 5.2, Sending SMSes from the contact actions failed to send
What happened?
A refacot of the SMS Sending code PR CRM-21037 cased SMSes to not be able to send in single one off when the send an SMS action was selected when viewing a contact record.
How & When was it addressed
The bug was introduced when a variable in this case $doNotSms
was changed from an empty string to be TRUE. The variable was used in an if statement and previously an empty string was not resolving to be TRUE. However other uses of that variable before the if suggested it was meant to be a boolean variable. It was identified approximately around the time 5.3.1 was released, even tho the bug was introduced into 5.2.0. It will be addressed in either 5.5 or 5.4.1
How did the regression fit with our processes?
It fitted into our workflows because this was some code cleanup done in an effort to add unit tests to better guard against such regressions occurring in our system.
Recommendations going forwards
We need to be more careful when handing refactor, Refactor is the one time when its easy to miss something or not fully understand all the implications of a change. In this case it was making the variable into what it seemed to be a boolean that then caused issue. It would also be noted that when doing refactors if the code becomes testable, tests should be added to cover a majority of scenarios. In this case there were two missing scenarios which included when a phone_type_id is passed in as part of the contact details which is what happens when you do a single SMS