cancel
Showing results for 
Search instead for 
Did you mean: 

Escaped Share URL breaks TinyMCE on Safari

jpotts
World-Class Innovator
World-Class Innovator
In Alfresco Community 3.4, when a user logs in, here is their dashboard URL:

http://localhost:8081/share/page/user/tuser3@jpotts.metaversant-laptop.com/dashboard

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:

http://localhost:8081/share/page/site/testsite1/inline-edit?nodeRef=workspace://SpacesStore/13a55691...

Now change the URL to:

http://localhost:8081/share/page/user/foo@bar.com/inline-edit?nodeRef=workspace://SpacesStore/13a556...

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'
   org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1042)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   org.alfresco.web.scripts.servlet.StaticAssetCacheFilter.doFilter(StaticAssetCacheFilter.java:70)
   org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)

If you change the URL to:

http://localhost:8081/share/page/user/foo%40bar.com/inline-edit?nodeRef=workspace://SpacesStore/13a5...

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?
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
The fix is to change the way the links are built in the My Tasks Dashlet. I've put the update for the my-tasks.js file in this Jira ticket: http://issues.alfresco.com/jira/browse/ALF-6538

With this fix in place, you do not have to do the @ sign replacement fix that was outlined in the previous post in order to correct the Tiny MCE problem.

Jeff

mikeh
Star Contributor
Star Contributor
Thanks Jeff - looks like an easy fix we should be able to put in place quickly.

Cheers,
Mike
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.