bug in mailtemplate - removing any attachment when selecting template!

When selecting a mail template, it’s removing existing attachments.

This is horrible behaviour! I have a template for quotas. I create a quota, click “Send as PDF”- the PDF is in the mail, I select the template and poof gone is my attachment.

Please fix this ASAP. 10.2 didn’t fix this issue btw.

BTW - this worked in 7.8. After upgrading it doesn’t anymore.

Checked some things.

I think it’s due to the files in /modules/Emails/include/ComposeView/EmailsComposeView.js. There some shit there about attachments.

I installed a clean 7.10.2 and a clean 7.8.17. It works perfectly fine in 7.8.17 (the original attachment stays, attachments in the templates are added to the original ones). It cleans all the attachments in 7.10.2 whenever you select a template (both when the template contains an attachment and when it doesn’t).

Which of these two versions of the file do you have, the one on the left or the one on the right?

https://github.com/salesagility/SuiteCRM/commit/3a8d8e77489df1621841e4d1a5dfc5a6989ffdc4

None of both but it looks more like the file on the left than the file on the right. For example: my files contains lines 516.524 from the file on the left, but it doesn’t contain lines 992/999.

See https://pastebin.com/ZGRwFgrD

I copied the one on the right. Although it doesn’t break the mail function it doesn’t fix the fact that all attachments are being removed when selecting a template.

If that fix isn’t exactly what you need, maybe it’s better if you open a new Issue on GitHub with your specific problem. Thanks for reporting.

As said, an exact copy still removes the attachments. And please keep in mind this is on all the instances of the SuiteCRM 10.2 I installed (production, development and testing) with all three different PHP versions. Therefor I think it’s a bug in 10.2. Can you confirm you have the same issue on a fresh install of 10.2?

I already opened a bug on GitHub - no one replied there yet though. https://github.com/salesagility/SuiteCRM/issues/5520

Hi Nave,

I’ve confirmed this as an issue. Thanks.

Thanks. I see you gave it a medium priority. I would consider it a high priority. We can’t send quotas, contracts, invoiced, reminders etcetera.

Yes, but it’s a “medium priority” that got a fix on the next day :slight_smile:

Nope, sadly enough. Only partial fix.

@PedroErnst - this commit fixes the delete of the attachment but it causes another problem with attachment

Scenario 1: Not selecting a mailtemplate - attachments gets send.
Scenario 2: Selecting a mailtemplate without attachment in template - attachments gets send.
Scenario 3: Selecting a mailtemplate with attachment in template - the attachment from the mailtemplate gets send. The original attachment doesn’t.

In all scenario’s I can see all the attachments in the composer. So that works. However, in scenario 3 the original attachment doesn’t get send, although it shows in the composer.