AnsweredAssumed Answered

Escaped Share URL breaks TinyMCE on Safari

Question asked by jpotts Moderator on Jan 6, 2011
Latest reply on Jan 7, 2011 by mikeh
In Alfresco Community 3.4, when a user logs in, here is their dashboard URL:


Notice the "@" sign. In this case, we're using email address as the user id.

Here's the problem. Suppose you have a Share URL that looks like the one above and you try to use the TinyMCE editor. The JS includes appear to use the URL context to import the TinyMCE JavaScript, but they break because of the "@" sign.

In our case this happens when someone clicks the Dashboard link (which contains the @, out of the box) and manages a workflow task. We have a custom extension that invokes a SimpleDialog to let the user edit content. If that content is HTML, and if the user has an @ in their username, the editor does not show up. To fix this, we modified the header.get.html.ftl file to replace the @ sign in the userid token. This keeps the @ sign out of the URL and fixes the problem for Firefox and Chrome, but not Safari 5.

You can try this yourself without our workflow customizations. Go do an inline edit on a piece of HTML content in your Share site. Your URL will look something like this:


Now change the URL to:


The rich text editor breaks. If you look at the browser console, the Surf dispatcher servlet is having trouble rendering the view.

javax.servlet.ServletException: Could not resolve view with name 'user/foo@localhost:8081/share/res/modules/editors/tiny_mce/langs/en.js' in servlet with name 'Spring Surf Dispatcher Servlet'

If you change the URL to:


The rich text editor works, but only in Firefox and Chrome. Safari still breaks with the same error. It's almost like when Safari does the include, it is unescaping the URL string whereas Firefox and Chrome do the include with the @ sign escaped. Anyone seen this?