Details
-
Bug
-
Resolution: Timed out
-
Low
-
8
-
Severity 3 - Minor
-
Description
Summary
Cannot Load Space Directory in Confluence for All Spaces
Environment
- CONLFUENCE: 6.0.0-OD-2016.02.1-0006
- JIRA: 7.1.0-OD-04-012
- Chrome: Version 47.0.2526.106 (64-bit)
Steps to Reproduce
- Log into Confluence Cloud
- Spaces > Space Directory > All Spaces
Expected Results
- All Spaces link to load all spaces without throwing errors.
Actual Results
Error found in the Dev console for Chrome:
com.atlassian.confluence.plugins.confluence-space-directory:space-directory.js?locale=en-GB:9 Uncaught TypeError: Cannot read property 'href' of undefined
Details:
b.paginate.insertResults @ com.atlassian.confluence.plugins.confluence-space-directory:space-directory.js?locale=en-GB:9 (anonymous function) @ com.atlassian.confluence.plugins.confluence-space-directory:pagination-resources.js?locale=en-GB:69 d @ jquery-1.7.2-fd-cache3.js:18 p.fireWith @ jquery-1.7.2-fd-cache3.js:18 r @ jquery-1.7.2-fd-cache3.js:26 r @ jquery-1.7.2-fd-cache3.js:26
com.atlassian.confluence.plugins.confluence-space-directory:space-directory.js?locale=en-GB:9 Uncaught TypeError: Cannot read property 'href' of undefined
WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}} ; try { /* module-key = 'com.atlassian.confluence.plugins.confluence-space-directory:space-directory', location = 'js/space-directory.js' */ define("confluence-space-directory/space-directory","jquery window confluence/meta confluence/legacy ajs confluence-space-directory/pagination".split(" "),function(b,s,m,p,e){return function(){var j=b("#space-directory .aui-nav li"),n=b("#space-search-query"),q="",r=function(){var a=b("#space-directory .aui-nav-selected");return{type:a.parent().attr("id"),tabName:a.find("a").data("tab-name")}},v=function(){var a=r();return a.type=="space-system-list"&&a.tabName=="all"},t=function(a){a&&a.type&&a.tabName? b("#"+a.type+" a[data-tab-name="+a.tabName+"]").parent().addClass("aui-nav-selected"):b("#space-system-list a[data-tab-name=site]").parent().addClass("aui-nav-selected")};b("#space-search-result").paginate({nameSpace:"space-directory",url:m.get("context-path")+"/rest/spacedirectory/1/search",cache:false,pageUrl:m.get("context-path")+"/spacedirectory/view.action",getParams:function(){var a=m.get("remote-user"),c="current",o=[],f;if(a&&b("#favourites-toggle").hasClass("aui-nav-selected")){o=["~"+a+ ":favourite","~"+a+":favorite"];b("#space-search-title-bar .space-search-title").text("My Spaces")}a=b(".team-label.aui-nav-selected a");if(a.length>0){o.push("team:"+a.attr("data-tab-name"));c=a.attr("data-status-name");b("#space-search-title-bar .space-search-title").text(a.text())}if(!o.length){a=b(".space-type.aui-nav-selected a");if(a.length>0){f=a.attr("data-type-name");c=a.attr("data-status-name");b("#space-search-title-bar .space-search-title").text(a.text())}f||b("#space-search-title-bar .space-search-title").text("All Spaces")}return{query:q, label:o,type:f,status:c}},pageSize:+e.params.pageSize,startIndex:0,preprocess:function(){b(".no-results").addClass("hidden");b("#aui-message-bar").empty()},insertResults:function(a,c){var e=a.spaces,f=e.length===0;b(".no-results").toggleClass("hidden",!f||v()&&!n.val());b(".space-list-section").toggleClass("hidden",f);b("#space-directory-help").toggleClass("hidden",f);for(var f=0,i=e.length;f<i;f++){var d=e[f],h=p.Templates.SpaceDirectory.spaceListItem({spaceKey:d.key,spaceName:d.name,truncatedSpaceName:d.name, spaceDescHtml:d.description,spaceUrl:d.link[1].href,logoUrl:d.logo.href,remoteUser:m.get("remote-user")}),h=b(h);c.append(h);var k=d.favourite;b(".space-favourites a.icon-remove-fav",h).toggleClass("hidden",!k);b(".space-favourites a.icon-add-fav",h).toggleClass("hidden",k);d=d.labels.label;if(d.length>0){for(var h=b(".space-labels",h),g=k=0,l=d.length;g<l;g++)if(d[g].namespace==="team"){var j=b(p.Templates.SpaceDirectory.spaceLabel({spaceLabel:d[g].name}));k>2?j.addClass("hidden"):k++;h.append(j)}k> 2&&h.append(p.Templates.SpaceDirectory.spaceLabelEllipsis())}}b(".space-favourites").favourites({})},handleError:function(){e.messages.error({body:"An error occurred while searching for spaces.",closeable:false})}});var l=function(){b("#space-search-result").hasClass("updating-container")||e.trigger("update-list.space-directory",{startIndex:0});s.localStorage.setItem("lastSelectedSpaceDirectoryTab",JSON.stringify(r()))},i=function(a,b){e.trigger("analytics",{name:"confluence.space-directory."+a,data:b||{}})}; j.click(function(a){var c=b(this);a.preventDefault();j.removeClass("aui-nav-selected");c.addClass("aui-nav-selected");l();a=b.trim(c.text()).toLowerCase().replace(/\s/g,"-");c=c.hasClass("team-label")?"category":a+"-filter";i(c+".click",{category:r().tabName})});var g=b("#space-list");g.on("click",".space-name a",function(){i("space.click")});g.on("click",".space-label",function(a){a.preventDefault();j.removeClass("aui-nav-selected");b(".team-label a[data-tab-name='"+b(this).text()+"']").parent().addClass("aui-nav-selected"); l();i("space.category.click")});g.on("click",".entity-info-icon a",function(){i("space.info.click")});var u;n.keyup(function(){var a=b.trim(n.val());n.hasClass("placeholded")&&(a="");if(!/^\S{1,2}$/.test(a)){a!=""&&(a=a+" OR "+a+"*");if(q!=a){q=a;clearTimeout(u);u=setTimeout(function(){l();i("filter")},200)}}});b("#space-search-form").submit(function(a){var c=b("#space-list .space-list-item");if(!b("#space-search-result").hasClass("updating-container")&&c.length===1){s.location=b(c[0]).find(".space-name a").attr("href"); return e.stopEvent(a)}});(g=b("#space-directory").data("selected-tab"))?t({type:"space-labels-list",tabName:g}):t(JSON.parse(localStorage.getItem("lastSelectedSpaceDirectoryTab")));l()}});require("confluence/module-exporter").safeRequire("confluence-space-directory/space-directory",function(b){require("ajs").toInit(b)}); }catch(e){WRMCB(e)};
Problem Portion:
spaceDescHtml:d.description,spaceUrl:d.link[1].href,logoUrl:d.logo.href,remoteUser:m.get("remote-user")}),h=b(h);c.append(h);var k=d.favourite;b(".space-favourites a.icon-remove-fav",h).toggleClass("hidden",!k);b(".space-favourites a.icon-add-fav",h).toggleClass("hidden",k);d=d.labels.label;if(d.length>0){for(var h=b(".space-labels",h),g=k=0,l=d.length;g<l;g++)if(d[g].namespace==="team"){var j=b(p.Templates.SpaceDirectory.spaceLabel({spaceLabel:d[g].name}));k>2?j.addClass("hidden"):k++;h.append(j)}k>
Notes
Looking at JSON page: https://<EXAMPLE>.atlassian.net/wiki/rest/spacedirectory/1/search?query=&type=personal&status=current&pageSize=24&startIndex=0
1 user had a missing value for avatar image.
"logo": { "href": "/wiki/download/attachments/13206209/user-avatar", "type": "image/png", "rel": "logo" },
Avatar image is what is used for Personal Space logo. Since the logo was causing the error selecting "All Spaces" was not loading.
Probable Workaround
there are a few reports that this workaround was not successful
- Use Development browser tools to confirm his error:
com.atlassian.confluence.plugins.confluence-space-directory:space-directory.js?locale=en-GB:9 Uncaught TypeError: Cannot read property 'href' of undefined
- Pull up site JSON: https://<EXAMPLE>.atlassian.net/wiki/rest/spacedirectory/1/search?query=&type=personal&status=current&pageSize=24&startIndex=0
- Find the user where the href for the user is not a defined path. Example:
"href": "/wiki/download/attachments/13206209/user-avatar",
- Log into Confluence.
- Navigated to user's profile.
- Download the profile image and save locally.
- Rename image. Make sure there are no spaces or odd characters.
- Effect should be immediate. Check All space link to make sure Spaces now load.
Attachments
Issue Links
- derived from
-
CONFSERVER-40386 Can't share page with specific users, or add them to Calendar events (thumbnailLink is undefined, leading to JS error)
- Closed