Suitecrm: Attachments are not uploaded (saved) in EmailTemplates

Created on 30 May 2018  Â·  13Comments  Â·  Source: salesagility/SuiteCRM



Issue

When editing an EmailTemplate and adding an attachment, this attachement is not saved

Expected Behavior

We expect the attachment is saved

Actual Behavior


At a quick glance, I could see that the method handleAttachments() is not working good because in line 268 the variable $_FILES is empty

Possible Fix

Steps to Reproduce


  1. Edit an EmailTemplate
  2. Add an attachment
  3. Save
  4. Verify that the attachment is not saved

when editing an Email template:

attachment_edit

After saving it:

attachment_after_save

Context


Your Environment

  • SuiteCRM Version used: 7.10.5
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 60
  • Environment name and version (e.g. MySQL, PHP 7): MySQL 5.7, PHP5.6 / PHP 7.0
  • Operating System and version (e.g Ubuntu 16.04): Debian 9
Emails Critical Bug

Most helpful comment

This happens when editor is no mozaic.
To reproduce that,

  • change editor to tiny MCE in profile
  • Edit Email template
  • Add an attachment.
    You will see errors in the browser console:
    mozaic in undefined in Emails.js

There is a workaround by adding the following in modules/Emails/javascript/Email.js
if (typeof mozaik == 'undefined') mozaik={};
around line 215 (before //AJAX call begins)

All 13 comments

I can confirm it is happening to me also!

Hi @Abuelodelanada

I'm not able to reproduce this. Uploads get attached properly to templates.

Is there anything in your php error log?
What size is the file you're trying to upload and have you tried different files?

Hi @PedroErnst

There is no error in php error log.
I tested with small files (less than 1MB) in .png, .jpg, .pdf, etc format

The file is saved in cache/images/

upload2

But it is not attached...

I'm having the same problem, no entries in sugar or php logs.

Workaround: upload as a Suite document, then attach to email template.

SuiteCRM 7.10.7 (updated recently from Sugar 6.5.x)
PHP 5.6, MariaDB10 (sqli)
Firefox 61
GNU/Linux Diskstation 3.10.105

This happens when editor is no mozaic.
To reproduce that,

  • change editor to tiny MCE in profile
  • Edit Email template
  • Add an attachment.
    You will see errors in the browser console:
    mozaic in undefined in Emails.js

There is a workaround by adding the following in modules/Emails/javascript/Email.js
if (typeof mozaik == 'undefined') mozaik={};
around line 215 (before //AJAX call begins)

@QuickCRM I'm able to replicate this as well. Thanks!

I just created a pull request in hotfix branch.
Again, I’m not sure that’s the nicest way to fix it as I don’t really understand if this mozaik variable should contain useful data for non-mozaik editors, but it looks like it fixes that.

—
[email protected]
www.quickcrm.fr/mobile http://www.quickcrm.fr/mobile
Visit our FAQ http://www.quickcrm.fr/mobile/en/content/16-faq

Le 19 sept. 2018 à 15:59, Dillon-Brown notifications@github.com a écrit :

@QuickCRM https://github.com/QuickCRM I'm able to replicate this as well. Thanks!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/salesagility/SuiteCRM/issues/5961#issuecomment-422814665, or mute the thread https://github.com/notifications/unsubscribe-auth/AH3OMiCHgAyJn362ewwd5uZhwjze32Cvks5uck2_gaJpZM4UTvKY.

We tested on latest 7.10.11 http://www.softaculous.com/demos/SuiteCRM and the issue still apear

@samus-aran @Dillon-Brown we tested the patch and it's working. Should be this ticket added to milestone 7.10.12 ?

It's very important issue which make all community the sending process of emails with attachments very unconfortable. Also it has FATAL influece on Campaings becasue you can't send email with attachment 📧

Hi @Mausino - If you mean patch that is the one QuickCRM has added (and we've merged) https://github.com/salesagility/SuiteCRM/pull/6329?

I do think that there is still an underlying issue but hopefully adding that patch will provide at least a workaround.

Regards to adding this to the milestone the team has alot of work to do with emails in this milestone so perhaps we can re-look at this as a later milestone. This is something we need to come together to revise the communities' higher priorities in time for the next milestone perhaps a somewhat voting system or a pre-sprint backlog grooming?

Hi Ashley,

May I suggest you put higher priority to Email Templates.
This is not the only problem.
Another major problem is variables not parsed since you changed the template parser to introduce surveys.
This is especially significant for non english users.
For example, salutation key will be shown instead of Monsieur, Madame, Herr, …

—
[email protected]
www.quickcrm.fr/mobile http://www.quickcrm.fr/mobile
Visit our FAQ http://www.quickcrm.fr/mobile/en/content/16-faq

Le 10 déc. 2018 à 13:32, Ashley Nicolson notifications@github.com a écrit :

Hi @Mausino https://github.com/Mausino - If you mean patch that is the one QuickCRM has added (and we've merged) #6329 https://github.com/salesagility/SuiteCRM/pull/6329?

I do think that there is still an underlying issue but hopefully adding that patch will provide at least a workaround.

Regards to adding this to the milestone the team has alot of work to do with emails in this milestone so perhaps we can re-look at this as a later milestone. This is something we need to come together to revise the communities' higher priorities in time for the next milestone perhaps a somewhat voting system or a pre-sprint backlog grooming?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/salesagility/SuiteCRM/issues/5961#issuecomment-445799671, or mute the thread https://github.com/notifications/unsubscribe-auth/AH3OMlG8ZH3d2uZdn4rub00NbK71lfzXks5u3lRNgaJpZM4UTvKY.

Hi @QuickCRM

Yup, we can raise the priority for this issue to "Higher" to indicate that it should be queued but I don't want to just add 'Higher Priority' to issues that aren't technically of that level and that is perhaps why a more collaborative solution would be better for the long term. But for the immediate solution just now for this particular issue would be to add this label.

Regards to the current milestone here we have already included email variables to be reviewed by the internal team. https://github.com/salesagility/SuiteCRM/issues?q=is%3Aopen+is%3Aissue+milestone%3A7.10.12

@QuickCRM yes, the patch #6329 is working for us :) will fine if will get some milestone label :) that we don't forget on it. When will in hotfix branch we can test it on https://nightly.suiteondemand.com/index.php?action=Login&module=Users

I am suggestion some other branch as prerelase-hotfix + some site for testing of it :D will branch where can be issue tested before will merged to hotfix.. because in hotfix we want 100% solutions... and it's time-consuming to copy this code to fresh installation or our instance... (i am not magician that i can work with git as expert and deploy it on live)

Hi @Mausino, Just to confirm, this issue is resolved for you on 7.10.11? It appears to be resolved on demo with editor to tiny MCE. I think this issue can be closed as the fix was merged in a previous release. I'll re-open if this is not the case.

Was this page helpful?
0 / 5 - 0 ratings