Details
-
Bug
-
Resolution: Fixed
-
Medium
-
5.4.4
-
None
Description
Workaround
Note: This workaround requires you to edit the "Custom HTML" settings in Confluence, which we classify as a "customization" to Confluence. Please keep track of this change and ensure that if/when you upgrade Confluence to a newer version, you verify whether or not this customization should remain in place or be removed.
- Go to the "Custom HTML" section of the Confluence Administration Console.
- Add the following text to the "At end of the HEAD" section:
<script type="text/javascript"> var $ = jQuery; </script>
It should look like this:
Note: If you already have some other content in this section, you will need to merge it together with this addition.
Steps to replicate:
- Install a Confluence 5.4.4 clustered version from scratch.
- Try to mention.
- Here is the output:
Environment:
Tomcat 7.0.53
Digging the error:
try { /* module-key = 'com.atlassian.confluence.plugins.confluence-mentions-plugin:editor-autocomplete-mentions', location = 'js/tinyMce-autocomplete-settings-mentions.js' */ AJS.Rte.BootstrapManager.addOnInitCallback(function(){if(!Confluence.Editor.Autocompleter){Confluence.Editor.Autocompleter=tinymce.confluence.Autocompleter}var b=function(e){if(e){return AJS.params.contextPath+"/rest/prototype/1/search.json"}else{if(AJS.Meta.get("remote-user")){return AJS.params.contextPath+"/rest/mentions/1/network.json"}}return null},c=function(g,f){var e={"max-results":g.maxResults||10};if(f){e.query=Confluence.unescapeEntities(f);e.search="user"}return e},a=function(m,f,l,h,g){var k=m.statusMessage;var i;if(k){i=[[{html:m.statusMessage,className:"error"}]]}else{var e=[];i=[e];if(m.result){AJS.$.each(m.result,function(n,p){var o=AJS.$.extend({},p);o.key=o.username;o.linkAlias=o.title;o.title=o.title+" ("+o.username+")";e.push(o)})}i=AJS.REST.convertFromRest(i)}function j(o,n){if(g&&typeof g=="function"){g(i,o,n)}}l(i,f,j)},d=function(g,i,m,f,l,o,j){var e=i(f),k=g.settings.cacheManager,h=k.get(f),n;if(e){n=$.ajax({type:"GET",url:e,data:m(g,f),dataType:"json",global:false,timeout:10000});n.done(function(p){k.put(f,p)});if(h){a(h,f,l,o,j)}else{n.done(function(p){a(p,f,l,o,j)});n.fail(function(q,p){if(p=="timeout"){a({statusMessage:"Timeout",query:f},f,l,o)}})}}else{l([],f)}};Confluence.Editor.Autocompleter.Settings["@"]={ch:"@",endChars:[],dropDownClassName:"autocomplete-mentions",selectFirstItem:true,getHeaderText:function(f,e){if(e){return "User suggestions"}else{return "Mention someone by typing their name..."}},getAdditionalLinks:function(h,f,g){var e=[];g(f,e);return e},getDataAndRunCallback:function(g,e,f){d(g,b,c,e,f,"content",function(h,j,i){if(j!==""&&h.length<2){if(i.length==0){i.push({html:'<span class="no-result">'+"No user found"+"</span>"})}}else{i.length=0}})},update:function(g,e){if(e.restObj){var f=AJS.$.extend(e.restObj,{title:e.restObj.linkAlias});e=Confluence.Link.fromREST(f)}e.insert()}}}); } catch (err) { if (console && console.log && console.error) { console.log("Error running batched script."); console.error(err); } }