Email Addresses being Deleted by Workflow

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.

Hi, sorry to hear about all the trouble you went through with this.

I would say you could start by posting your experience and any data you have on the GitHub issue you linked. There are users there who have been contributing quite intensely to SuiteCRM, I am hoping one of them might pick this up and solve it.

Also, you can try a demo with admin access here:

https://www.softaculous.com/demos/SuiteCRM

Thanks. Please keep me updated on this

1 Like

Reproduced it on admin demo. Deletes all but 2 emails. I created a github issue here: https://github.com/salesagility/SuiteCRM/issues/7842

Time to get started on recovering all lost data since June. Thanks for the admin demo.

Thanks for reporting on GitHub. Sorry for your troubles, let’s hope this can be fixed soon…