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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.6-rc-1
    • Fix Version/s: 14.3-rc-1
    • Component/s: Old Core
    • Labels:
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

                Dates

                Created:
                Updated:
                Resolved: