[ 
https://issues.apache.org/jira/browse/JSPWIKI-1162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453418#comment-17453418
 ] 

Juan Pablo Santos Rodríguez commented on JSPWIKI-1162:
------------------------------------------------------

Hi [~gary_kephart], been unable to reproduce this issue, neither on a running 
JSPWiki instance, nor with the following unit tests, that should replicate it 
(you can add them to {{PageRenamerTest}} in order to run them):
{code:java}
    @Test
    public void testReferrerChangeMultiRename() throws Exception  {
        m_engine.saveText("TestPage", "foofoo" );
        m_engine.saveText("TestPage2", "[TestPage]");

        final Page p = m_engine.getManager( PageManager.class 
).getPage("TestPage");
        final Context context = Wiki.context().create(m_engine, p);
        m_engine.getManager( PageRenamer.class ).renamePage(context, 
"TestPage", "FooTest", true);
        m_engine.getManager( PageRenamer.class ).renamePage(context, "FooTest", 
"BarTest", true);

        final String data = m_engine.getManager( PageManager.class 
).getPureText("TestPage2", WikiProvider.LATEST_VERSION);
        Assertions.assertEquals( "[BarTest]", data.trim(), "no rename" );

        Collection< String > refs = m_engine.getManager( ReferenceManager.class 
).findReferrers("TestPage");
        Assertions.assertNull( refs, "oldpage" );
        refs = m_engine.getManager( ReferenceManager.class 
).findReferrers("FooPage");
        Assertions.assertNull( refs, "oldpage" );
        refs = m_engine.getManager( ReferenceManager.class ).findReferrers( 
"BarTest" );
        Assertions.assertEquals( 1, refs.size(), "new size" );
        Assertions.assertEquals( "TestPage2", refs.iterator().next(), "wrong 
ref" );
    }

    @Test
    public void testReferrerChangeMultiRename2() throws Exception  {
        m_engine.saveText("TestPage", "foofoo" );
        m_engine.saveText("TestPage2", "[Test|TestPage]");

        final Page p = m_engine.getManager( PageManager.class 
).getPage("TestPage");
        final Context context = Wiki.context().create(m_engine, p);
        m_engine.getManager( PageRenamer.class ).renamePage(context, 
"TestPage", "FooTest", true);
        m_engine.getManager( PageRenamer.class ).renamePage(context, "FooTest", 
"BarTest", true);

        final String data = m_engine.getManager( PageManager.class 
).getPureText("TestPage2", WikiProvider.LATEST_VERSION);
        Assertions.assertEquals( "[Test|BarTest]", data.trim(), "no rename" );

        Collection< String > refs = m_engine.getManager( ReferenceManager.class 
).findReferrers("TestPage");
        Assertions.assertNull( refs, "oldpage" );
        refs = m_engine.getManager( ReferenceManager.class 
).findReferrers("FooPage");
        Assertions.assertNull( refs, "oldpage" );
        refs = m_engine.getManager( ReferenceManager.class ).findReferrers( 
"BarTest" );
        Assertions.assertEquals( 1, refs.size(), "new size" );
        Assertions.assertEquals( "TestPage2", refs.iterator().next(), "wrong 
ref" );
    }
{code}
Would you mind trying with latest JSPWiki to see if the issue persist? there 
aren't changes that might affect renaming between both M8 and 2.11.0, but just 
to be sure.. I've also tried to reproduce the issue at jspwiki-wiki.a.o, which 
is right now 2.11.0.M5, and haven't succeeded, so not sure what might be 
happening or how to trigger it.

Finally, do you have some special/custom configuration, filter, plugin, etc. 
that might trigger the issue?

> Multiple page renames (with updating referrers) causing problems
> ----------------------------------------------------------------
>
>                 Key: JSPWIKI-1162
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-1162
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Editors
>    Affects Versions: 2.11.0-M8
>            Reporter: Gary Kephart
>            Priority: Major
>
> When page A gets renamed to B and the referrers are to get updated, the 
> referrers have [A|B] in their pages, which is what is expected.
> However, when page B gets renamed to C and the referrers are to get updated, 
> the referrers have [A|B|C] in their pages, which is not what is expected. I 
> would expect [A|C].



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to