Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-54008

Space Directory not loading for All Spaces

    XMLWordPrintable

Details

    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

      1. Log into Confluence Cloud
      2. Spaces > Space Directory > All Spaces

      Expected Results

      1. 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

      1. 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
        
      2. Pull up site JSON: https://<EXAMPLE>.atlassian.net/wiki/rest/spacedirectory/1/search?query=&type=personal&status=current&pageSize=24&startIndex=0
      3. Find the user where the href for the user is not a defined path. Example:
            "href": "/wiki/download/attachments/13206209/user-avatar",
        
      4. Log into Confluence.
      5. Navigated to user's profile.
      6. Download the profile image and save locally.
      7. Rename image. Make sure there are no spaces or odd characters.
      8. Effect should be immediate. Check All space link to make sure Spaces now load.

      Attachments

        1. error.png
          error.png
          354 kB
        2. loading.png
          loading.png
          402 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jromero@atlassian.com Jose R. (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: