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

ASF subversion and git services commented on JSPWIKI-919:
---------------------------------------------------------

Commit bd6d30cebd102e7905ed226fc855f86cb2f86f2b in jspwiki's branch 
refs/heads/master from Arturo Bernal
[ https://gitbox.apache.org/repos/asf?p=jspwiki.git;h=bd6d30ceb ]

JSPWIKI-919 VersioningFileProvider.pageExists() ignores the first version of a 
page without history

A page dropped into the page directory has no OLD/ directory yet. getPageInfo()
treats it as version 1, but pageExists( name, 1 ) looked into OLD/ and returned
false. With the page cache disabled the page was reported as not existing.
Apply the same rule in pageExists().


> FileSystemProvider created pages not displayed by VersioningFileProvider if 
> page caching turned off 
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JSPWIKI-919
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-919
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.10.1
>         Environment: Windows 7 Professional SP1
>            Reporter: Paul Illingworth
>            Priority: Major
>              Labels: pull-request-available
>
> I have an install of JSPWiki (2.10.1) that has been preloaded with a set 
> of (my own) wiki pages. These pages are dropped into the 
> ${jspwiki.fileSystemProvider.pageDir} directory as just .txt files. There 
> are no property files and I have no OLD directory. The page provider is 
> set to the VersioningFileProvider.
> With page caching on all works as expected.
> When I turn page caching off [*] none of my pages get displayed and 
> instead I get "This page does not exist. Why don’t you go and create it?". 
> If I say yes the page is loaded for me to edit. If I change the page and 
> save it it then becomes visible.
> It seems that the issue is with 
> org.apache.wiki.providers.VersioningFileProvider.pageExists(String, int) 
> and org.apache.wiki.providers.CachingProvider.pageExists(String, int) 
> returning different values if page caching is on or off.
> With caching on
> org.apache.wiki.providers.CachingProvider.pageExists(String, int) returns 
> true
> With caching off 
> org.apache.wiki.providers.VersioningFileProvider.pageExists(String, int) 
> returns false 
> It seems that this is because the OLD/pageName directory does not exist 
> (e.g. for the MAIN page jspwiki/pages/OLD/Main does not exist) and 
> org.apache.wiki.providers.VersioningFileProvider.pageExists(String, int) 
> does not handle this situation.
> Can be "fixed" by replacing pageExists(...) in VersioningPageProvider with 
>    public boolean pageExists(String pageName, int version)
>     {
>         try
>         {
>             WikiPage p = getPageInfo(pageName, version);
>             return p != null;
>         }
>         catch (ProviderException e)
>         {
>             return false;
>         }
>     }
> although I am not sure of the implications of this.



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

Reply via email to