Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19624

The XWikiDocument#getUniqueLinkedPages() API doesn't work when page reference links are used and they point to terminal pages

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      This is because the default EntityReferenceResolver<ResourceReference> used to convert PageReference to DocumentReference adds a WebHome.

      For example: [[page:test]] will have the method return test.WebHome, even if test is a terminal page.

      The solution is to test for the existence of document pointed to by the reference, even if that's more costly. That's the only way to get a valid list of references. This is important since for example this method is called to save backlinks in the DB and if the reference is wrong then links to terminal pages won't be refactored properly when a page reference is used.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: