Alfresco 5.0.a document library woes with Internet Explorer.

by glmotorsports

Here’s a quick hacky workaround for the issue of the document library refusing to display anything in Internet Explorer.  Note that it’s specific to Alfresco 5.0.a as the document library code has been re-worked in 5.0.b. to correct this issue.  I did not develop this hack myself, but ran across it on the web awhile back.  I’d love to give credit to the person that threw the original hack together, but my google-fu is failing me.  That’s actually why I’m re-posting here.  Someone asked me about it and I couldn’t find that blog post, had to go digging in my code and internal documents to scare up the code again!  Here’s the quick and dirty version for those able to tangle with Alfresco internals (and recover if something goes wrong as I can offer no guarantees on this code for any particular install as yours may be different in some critical way!).

Alfresco 5.0a has a bug in the document library renderer that’s supposed to be fixed in 5.0b and later. Append this (and then restart tomcat) to  alfresco-5.0.a/tomcat/webapps/share/WEB-INF/classes/alfresco/templates/org/alfresco/include/alfresco-template.ftl:

if (!document.baseURI)
{ HTMLElement.prototype.baseURI = document.URL; }