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

Arturo Bernal commented on JSPWIKI-347:
---------------------------------------

Reproduced on current master with the test engine (PageRenamer), without the 
web page of the renamer. Renaming the page Blubb & Bla to Blubb& Bla with the 
references updated turns the link [Blubb & Bla] into [Blubb & Bla|Blubb& Bla], 
as in the report, and the page that had the link is then a referrer of the new 
name, so the link does point to the renamed page.

This does not depend on the ampersand. With blanks in the name, [Foo Bar] 
becomes [Foo Bar|Foo Baz] when Foo Bar is renamed to Foo Baz, while a WikiName 
such as [FooPage] becomes [BarPage]. The code is replaceSingleLink in 
DefaultPageRenamer, and its comment says that when the original has blanks a 
link is introduced, [My Page] => [My Page|My Renamed Page], so the text that 
readers see does not change. So what the report shows is the intended behaviour 
for names with blanks, and the two names are detected as the same page. A 
normal form of page names, as suggested in the first comments, would be a 
design decision.

While reproducing it I found a real defect in the same method. For a link that 
already has a text, [my label|Lbl Page], renaming Lbl Page to Lbl Other gave 
[my label|Lbl Page|Lbl Other], and the referrer stayed on the old name, so the 
link was broken; with a WikiName such as LblPage it worked. This is the cause 
of JSPWIKI-1162, and it is fixed in pull request 554, which is not merged yet: 
on that branch the result is [my label|Lbl Other] and the referrer is on the 
new name.

Limits: I measured it with a test that uses the engine, not through the renamer 
page of a running wiki, and only with the names above. Leaving the issue open 
for the decision on the design.

> page renamer's page name equality detection is wrong
> ----------------------------------------------------
>
>                 Key: JSPWIKI-347
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-347
>             Project: JSPWiki
>          Issue Type: Bug
>    Affects Versions: 2.7.x
>         Environment: JSPWiki v2.7.0-alpha-19  
>            Reporter: Florian Holeczek
>            Priority: Minor
>
> * Create a page via the SandBox named "Blubb & Bla"
> * Rename this page to "Blubb& Bla" with update references checked
> The page renamer then changes the link in the SandBox to "[Blubb & Bla|Blubb& 
> Bla]". Obviously it can't detect the equality correctly.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to