Can't change SMS recipient on non-bulk SMS
To replicate:
- Set up any SMS provider.
- Have/create at least two contacts with a mobile number.
- Go to that contact, select "Outbound SMS" from the action menu.
If you send the SMS at this point, everything is good. However:
- Try adding a second contact. Or removing and re-adding the first contact.
Now, if you try sending, you get an exception:
CRM_Core_Exception: One of parameters (value: "Lastname) is not of the type Positive
Why:
The AJAX that powers the contact selection widget here, CRM_Contact_Page_AJAX::getContactPhone()
returns the data in one of two formats, depending on whether you pass in an id = TRUE
parameter. The JS here doesn't, but it should - otherwise the contact name/phone comes back in the wrong format.