Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9623

ResourceMapperImpl.getAllMappings is incomplete for nested alias

    XMLWordPrintableJSON

    Details

      Description

      while investigating an issue involving sling:alias, i inadvertently created nested alias i.e. ended up having an alias define for the parent and a child page.

      when looking at the values obtained from ResourceMapper.getAllMappings, i noticed that it only contains 1 combination. cross-checking however revealed that all combinations define valid paths that are properly resolved by sling.

      Example

      parent: /parent with alias name 'alias-parent'
      child: /parent/child with alias name 'alias-child'
      valid paths for the child are (and expected from ResourceMapper.getAllMappings):

      • /parent/child
      • /parent/alias-child
      • /alias-parent/alias-child
      • /alias-parent/child

      actual values obtained from ResourceMapper.getAllMappings:

      • /parent/child
      • /alias-parent/alias-child

      consequently, an consumer of ResourceMapper.getAllMappings will miss valid alias path mappings. with additional nesting or addition of multiple alias values (see SLING-9620), the number of missed paths will increase.

        Attachments

        1. SLING-9623-test.patch
          4 kB
          Angela Schreiber

          Issue Links

            Activity

              People

              • Assignee:
                rombert Robert Munteanu
                Reporter:
                angela Angela Schreiber
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: