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

Forward links are not refactored on rename causing broken links on rename to different space.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.7 RC1
    • 2.6
    • {Unused} Core
    • None
    • rename links
    • Unit
    • Easy

    Description

      Test case:

      {{groovy}}
      // Test whether or not moving to a different space breaks FORWARD links.
      renameFrom = "test2.target";
      renameTo = "test2B.target";
      linksTo = "test2.source";
      
      renDoc = xwiki.getDocument(renameFrom);
      renDoc.setContent("[[" + linksTo.substring(linksTo.indexOf(".") + 1) + "]]");
      renDoc.save();
      
      sourceDoc = xwiki.getDocument(linksTo);
      sourceDoc.save();
      
      renDoc = xwiki.getDocument(renameFrom);
      delDoc = xwiki.getDocument(renameTo);
      delDoc.delete();
      renDoc.rename(renameTo);
      
      println("Are FORWARD links refactored?");
      renDoc = xwiki.getDocument(renameTo);
      println("~" + renDoc.getContent() + " should equal ~[[test2.source]]");
      
      {{/groovy}}
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            calebjamesdelisle CalebJamesDeLisle
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: