We’re using workflow to modify a contact status when a task is created (NOTE: this has NOTHING to do with email addresses) although I have gotten it manifest in other workflows updating different fields related to contact. All of these workflows have other differences (On Save vs. Scheduler etc.).
However, recently, some of my coworkers were noticing email addresses disappearing. It took a lot of digging but using database triggers, custom logs, and looking at relative issues on github this is what I have found:
The email address itself isn’t being deleted, the value for “deleted” on the email_addr_bean_rel table is being set to one. Using the database trigger, I was able to update date modified every time this happened.
I found this issue on github: https://github.com/salesagility/SuiteCRM/issues/6983 and thought the result looked similar. After customizing the SugarEmailAddress.php file and adding custom logs for a breadcrumb trail, it would seem that for some odd reason, workflow is leaving email addresses in the $current_links variable (just after line 695 is where I was able to see each email_addr_bean_rel’s id in the array, before they were deleted), therefore when it gets down to the deletion part of this file (Line 736) it is deleting all but 2 emails associated with the contact.
We have now lost probably upwards of a hundred emails due to this bug. I am wondering whether anyone else has come across something like this, and should it should be posted to github? I can’t replicate it on demo because I can’t create workflows there.