Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Allow dragged images in the rich text editor to be uploaded correctly #13016

Merged
merged 8 commits into from
Sep 19, 2022

Conversation

iOvergaard
Copy link
Contributor

Description

While upgrading TinyMCE for v11, we discovered that drag&drop of images did not work as intended in TinyMCE, where the images would be pasted as base64 inline data, and after fixing that, they did not land in the correct tmp folder on the server (needed to use ContentRoot instead of WebRoot in TinymceController). Also, absolute paths on MacOS at least was erroneously being handled as relative paths which further resulted in the server not being able to find the tmp images. The last key to the fix was to parse the returned JSON response from the UploadImage endpoint since it uses the special AngularJS prefix so we needed to split by newlines and take the second line of the response since we are working with a raw XHR object.

Copy link
Member

@bergmania bergmania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💪

@bergmania bergmania merged commit d18dc92 into v10/dev Sep 19, 2022
@bergmania bergmania deleted the v10/bugfix/tinymce-dragdrop branch September 19, 2022 08:29
@iOvergaard iOvergaard changed the title V10: Fix to allow dragged images in the rich text editor to be correctly uploaded Fix: Allow dragged images in the rich text editor to be uploaded correctly Sep 19, 2022
nul800sebastiaan pushed a commit that referenced this pull request Sep 19, 2022
…tly uploaded (#13016)

* update string extensions IsFullPath to support more filepaths with new built-in Path.IsPathFullyQualified

* resolve TODO to switch to Path.IsPathFullyQualified supported from .NET Standard 2.1

* Use content root instead of web root for uploaded images

* Un-break a breaking change

* handle special parsing of AngularJS json response

* change htmlId selector to support html id's with numbers

* remove bad test case

* test IsFullPath without tricky UNC paths that are not useful

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
(cherry picked from commit d18dc92)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants