diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java index 4f25b0678119ceb217d5a0e9b157bc57ae03d717..3e877b58f901d704a1fb01921b1077a6a4072c79 100644 --- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java +++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java @@ -43,6 +43,7 @@ import org.olat.core.gui.translator.Translator; import org.olat.core.helpers.Settings; import org.olat.core.logging.OLog; import org.olat.core.logging.Tracing; +import org.olat.core.util.CodeHelper; import org.olat.core.util.Formatter; import org.olat.core.util.UserSession; import org.olat.core.util.Util; @@ -629,7 +630,7 @@ public class RichTextConfiguration implements Disposable { } else { // Add classname to the file path to remove conflicts with other // usages of the same file path - mapperID = this.getClass().getSimpleName() + ":" + mapperID; + mapperID = this.getClass().getSimpleName() + ":" + mapperID + ":" + CodeHelper.getRAMUniqueID(); contentMapperKey = CoreSpringFactory.getImpl(MapperService.class).register(usess, mapperID, contentMapper); } diff --git a/src/main/webapp/static/js/tinymce4/BTinyHelper.js b/src/main/webapp/static/js/tinymce4/BTinyHelper.js index d6b679b99f0c19acf30b42e2e48d23a1a5fe5565..011d9974f2109715b4c784867c3b77b65a129a5c 100644 --- a/src/main/webapp/static/js/tinymce4/BTinyHelper.js +++ b/src/main/webapp/static/js/tinymce4/BTinyHelper.js @@ -79,9 +79,12 @@ var BTinyHelper = { // 2) http://localhost/olat/classpath/62x/org.olat.core.gui.components.form.flexible.impl.elements.richText/js/tinymce/ // 3) http://localhost/olat/url/RepositoryEntry/27361280/ (REST URL and permalinks) // 4) http://localhost/olat/auth/abc/go?xyz (old jump in URL's) - } else { - // convert to relative path using TinyMCE standard conversion - url = editor.documentBaseURI.toRelative(url); + } else if(url.indexOf('/m/') == 0) { + // convert media + var index = url.indexOf('/',4); + url = url.substring(index + 1, url.lengths);//remove /m/{32 characters of mapper id}/ + } else if(url.indexOf('http://') == 0 || url.indexOf('https://') == 0) { + url = editor.documentBaseURI.toAbsolute(url, true); } } else { // Convert to absolute