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

email templates 7.10.10 tinymce: tinyMCE Editor cannot Hyperlink images #6546

Open Lehnerr opened 5 years ago

Lehnerr commented 5 years ago

I want to hyperlink a image, when I enter the url and want to safe it nothing happens.

hyperlink

Issue

I want to Hyperlink an image. I select the image click Link, enter the url and want to save it. Nothing happens.

Expected Behavior

Hyperlink should be saved.

Actual Behavior

No saving is possible.

Possible Fix

as Workaround: after I type the href tag in the code, the link button can change the URL i have manually entered. It cannot create the href tag.

Steps to Reproduce

1.insert Image 2.select image 3.klick link 4.enter url and klick OK

Context

Your Environment

dtosun61 commented 4 years ago

Any solution for this. We could not insert image link :(

pgorod commented 4 years ago

Can you please check if this makes a difference? https://github.com/salesagility/SuiteCRM/issues/3672#issuecomment-691478076

dtosun61 commented 4 years ago

Can you please check if this makes a difference? #3672 (comment)

Same result :(

pgorod commented 4 years ago

You're right, this is not an issue of SuiteCRM clearing out the link, it's a TinyMCE problem.

If you note the Javascript error (Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.), you'll find plenty of pages mentioning this on Google.

This one states that TinyMCE 4.6 solves this bug...

https://magento.stackexchange.com/questions/178624/cannot-edit-widgets-in-wysiwyg-editor-anymore

It also includes a code hack to fix it, and suggests a workaround: select the image as if it were text (include a space also, which you can later remove in source editor).

dtosun61 commented 4 years ago

Yes i know, this bug is TinyMCE problem. But Suite CRM doesn't update TinyMCE🙄 I couldn't do it myself 😔 TinyMCE editor doesn't good to use it with this version.

pgorod commented 4 years ago

Are you aware of this?

https://github.com/salesagility/SuiteCRM/pull/6699

it's merged in develop branch.

It's not that hard to implement...

dtosun61 commented 4 years ago

140 files are changed. That is really risk for my production:(

dtosun61 commented 4 years ago

You're right, this is not an issue of SuiteCRM clearing out the link, it's a TinyMCE problem.

If you note the Javascript error (Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.), you'll find plenty of pages mentioning this on Google.

This one states that TinyMCE 4.6 solves this bug...

https://magento.stackexchange.com/questions/178624/cannot-edit-widgets-in-wysiwyg-editor-anymore

It also includes a code hack to fix it, and suggests a workaround: select the image as if it were text (include a space also, which you can later remove in source editor).

This solution for image selection bug, not image hyper link bug?

pgorod commented 4 years ago

Most of that is just removing a lot of files from include/javascript/mozaik/vendor/tinymce. They will be replaced by what Composer will grab from the Internet and place in vendor/tinyMCE. You can even leave the old files there and just do the other changes, to point to the new TinyMCE.

Any way, I do recommend that you test in some other server, not production.


About the workaround on that site: by selecting the image in a different way, it works around the bug and let's you create a link.

  1. Select the image with keyboard, not mouse (use the cursor and shift-arrows).
  2. Include the image and a space character in the selection.
  3. Now create the link normally.
  4. Check the "source editor" and if necessary remove the space ( )