Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-40706

getSpacesWithLabel(label) does not return any result even with a valid space category

    XMLWordPrintable

Details

    Description

      Summary.

      labelmanager.getSpacesWithLabel(label) does not return any result even with a valid space category.

      Step to replicate

      1. Create a space
      2. Add the 'test' into the space label/category
      3. Add a new User macro with the following template.
        #set($param0='test')
        #set($labelmanager=$action.getLabelManager())
        #set($label=$labelmanager.getLabel($param0) )
        #if ( $label )
            Valid Label
            #set ( $spaces = $action.labelManager.getSpacesWithLabel( $label ) )
            <ul>
            #foreach ( $space in $spaces )
                    <li><a href="$!space.urlPath">$!space.name</a></li>
            #end
            </ul>
        #else
            Not valid label
        #end
        
      4. Add use macro into a page

      Expected Result

      The page should display the following since the space with the label exist.

      Valid Label

      • <SPACENAME>

      Observed Result

      Only the following is displayed

      Valid Label

      Attachments

        Activity

          People

            Unassigned Unassigned
            jcheok Jing Hwa Cheok (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: