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

Renaming a page having a backlink in a macro contained in a section does not refactor the backlink

    XMLWordPrintable

Details

    • Unit, Integration
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      • Create Page A containing the following content:
      = Header =
      
      {{info}}
      [[Page B>>doc:Page-B.WebHome]]
      {{/info}}
      
      • Create Page B at "Page-B.WebHome"
      • Rename "Page-B.WebHome" to "Page-C.WebHome"

      Actual result

      The backlink to Page B in Page A is not renamed to "Page-C.WebHome" while it should. An error is raised as shown in the rename log below. Note that when the macro is not contained in a section, the backlink is refactored as expected.

      class java.security.InvalidParameterException: Provided Block to replace is not a child
          at org.xwiki.rendering.block.AbstractBlock.replaceChild(AbstractBlock.java:287)
          at org.xwiki.rendering.block.AbstractBlock.replaceChild(AbstractBlock.java:278)
          at org.xwiki.refactoring.internal.DefaultReferenceRenamer.innerRenameReferences(DefaultReferenceRenamer.java:154)
          at org.xwiki.refactoring.internal.DefaultReferenceRenamer.renameReferences(DefaultReferenceRenamer.java:119)
          at org.xwiki.refactoring.internal.DefaultReferenceUpdater.lambda$renameLinks$0(DefaultReferenceUpdater.java:271)
          at org.xwiki.refactoring.internal.DefaultReferenceUpdater.renameLinks(DefaultReferenceUpdater.java:149)
          at org.xwiki.refactoring.internal.DefaultReferenceUpdater.renameLinks(DefaultReferenceUpdater.java:236)
          at org.xwiki.refactoring.internal.DefaultReferenceUpdater.internalRenameLinks(DefaultReferenceUpdater.java:297)
          at org.xwiki.refactoring.internal.DefaultReferenceUpdater.renameLinks(DefaultReferenceUpdater.java:270)
          at org.xwiki.refactoring.internal.DefaultReferenceUpdater.update(DefaultReferenceUpdater.java:349)
          at org.xwiki.refactoring.internal.listener.BackLinkUpdaterListener.updateBackLinks(BackLinkUpdaterListener.java:152)
          at org.xwiki.refactoring.internal.listener.BackLinkUpdaterListener.maybeUpdateLinksAfterRename(BackLinkUpdaterListener.java:133)
          at org.xwiki.refactoring.internal.listener.BackLinkUpdaterListener.processLocalEvent(BackLinkUpdaterListener.java:96)
          at org.xwiki.observation.event.AbstractLocalEventListener.onEvent(AbstractLocalEventListener.java:87)
          at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:319)
          at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:284)
          at org.xwiki.refactoring.internal.job.AbstractCopyOrMoveJob.copyOrMove(AbstractCopyOrMoveJob.java:270)
          at org.xwiki.refactoring.internal.job.MoveJob.performRefactoring(MoveJob.java:108)
          at org.xwiki.refactoring.internal.job.AbstractCopyOrMoveJob.maybePerformRefactoring(AbstractCopyOrMoveJob.java:223)
          at org.xwiki.refactoring.internal.job.AbstractCopyOrMoveJob.process(AbstractCopyOrMoveJob.java:157)
          at org.xwiki.refactoring.internal.job.AbstractCopyOrMoveJob.process(AbstractCopyOrMoveJob.java:129)
          at org.xwiki.refactoring.internal.job.AbstractCopyOrMoveJob.process(AbstractCopyOrMoveJob.java:102)
          at org.xwiki.refactoring.internal.job.RenameJob.process(RenameJob.java:50)
          at org.xwiki.refactoring.internal.job.AbstractEntityJobWithChecks.runInternal(AbstractEntityJobWithChecks.java:66)
          at org.xwiki.refactoring.internal.job.AbstractCopyOrMoveJob.runInternal(AbstractCopyOrMoveJob.java:57)
          at org.xwiki.refactoring.internal.job.MoveJob.runInternal(MoveJob.java:68)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:829)
      

      Attachments

        1. Error_when_renaming_page.png
          80 kB
          Ilie Andriuta
        2. export.xar
          1 kB
          slauriere

        Issue Links

          Activity

            People

              surli Simon Urli
              slauriere slauriere
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: