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

Renaming a document renames its content links twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.1-rc-1
    • Fix Version/s: 14.6-rc-1
    • Component/s: Refactoring
    • Labels:
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Pull Request Status:
      Awaiting Committer feedback
    • Similar issues:

      Description

      Regression introduced in XWIKI-6732

      In AbstractCopyOrMoveJob#copyOrMove():

      ...1st time...
                  if (!this.atomicOperation(oldReference, newReference)) {
                      return false;
                  }
      
      ...2nd time...
                  this.observationManager.notify(afterEvent, this, this.getRequest());
      ...
      

      Notes:

      • atomicOperation calls XWiki#renameDocument()
      • and notify() will call RelativeLinkUpdateListener
      • Both do the same thing, i.e. refactor the document content links
      • Funnily if the old way (i.e. XWiki#renameDocument()) fails then the new way (i.e. RelativeLinkUpdateListener) isn't called

      We need to fix this to perform the refactoring only once.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: