salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.53k stars 2.09k forks source link

Local images not imported in 7.12.6 #9639

Open kunanSA opened 2 years ago

kunanSA commented 2 years ago

Issue

The email template cannot import image files, it can only use images from url

Expected Behavior

Import files from my computer

Actual Behavior

Since the Tinymce update, when wanting to import a local file. It is not possible, and it can only be done through the link

Environment

samus-aran commented 2 years ago

Requires additional effort to re-instate local file upload e.g. https://www.tiny.cloud/docs/demo/file-picker/

SinergiaCRM commented 2 years ago

Hi @samus-aran,

after updating to version 7.12.6 we have detected this same bug in mozaik. In version 7.12.4 TinyMCE did not offer this option but Mozaik did.

In version 7.12.4 we tried to implement the attach a local image button for tinyMCE but we didn't see how to achieve the same functionality as the attach images icon that appeared in mozaik. Consequently we created this issue: https://github.com/salesagility/SuiteCRM/issues/9586

The differences we saw between the functionality of mozaik and the implementation in tinyMCE were:

  1. Images were uploaded to the server when added from TinyMCE and not when saving the template.
  2. From Mozaik a note was created with the name of the file stored in the public folder.
  3. In tinyMCE we implemented that the note was created but still, the image was not added to the body of the email sent from the campaign.

After that attempt, we thought that the button that appeared in Mozaik was not implemented through TinyMCE, but was added by SuiteCRM, although we were unable to locate how it was done.

If it has to be done through tinyMCE, could you give us some clue as to what we missed or how to implement it?

Thanks

pgorod commented 2 years ago

@SinergiaCRM remember that Mozaik is just TinyMCE with some stuff on top.

The relevant code you're looking for might be this one:

https://github.com/salesagility/SuiteCRM/blob/master/modules/AOS_PDF_Templates/templateParser.php#L96-L112

... though you'll have to check, I am not sure

SinergiaCRM commented 1 year ago

Thanks @pgorod, although we haven't figured out how to use that code to bring back the behavior from previous versions.

We still have the idea that the button that appeared in Mozaik was not implemented through TinyMCE. For now, we'll wait to see if the SuiteCRM team can bring the functionality back in mozaik and add it to tinyMCE.

pgorod commented 1 year ago

Do you have access to an installation with the Mozaik that used to work? Can you see (browser dev tools, network tab) if there is a SuiteCRM request when you press the button to select a file, and tell me exactly what that request is?