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

Harry Metske commented on JSPWIKI-931:
--------------------------------------

(JIRA is down, so mail for now)...

There is piece of code in VersioningFileProvider that checks if you are
migrating from FileSystemProvider, that does not not handle the situation
correctly if you are not migrating from FileSystemProvider :
http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java?view=markup#l496


Proposing this patch :

Index:
jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
---
jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
(revision 1734304)
+++
jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
(revision )
@@ -491,7 +491,9 @@
             Properties props = getPageProperties( page.getName() );

             String authorFirst = null;
-            if ( firstUpdate )
+            // if the following file exists, we are NOT migrating from
FileSystemProvider
+            File pagePropFile = new File(getPageDirectory() +
File.separator + PAGEDIR + File.separator + mangleName(page.getName()) +
File.separator + "page" + FileSystemProvider.PROP_EXT);
+            if ( firstUpdate && ! pagePropFile.exists())
             {
                 // we might not yet have a versioned author because the
                 // old page was last maintained by FileSystemProvider

regards,
Harry





> WeblogEntryPlugin creates entry "by unknown" when it should be an 
> authenticated user
> ------------------------------------------------------------------------------------
>
>                 Key: JSPWIKI-931
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-931
>             Project: JSPWiki
>          Issue Type: Bug
>    Affects Versions: 2.10.1
>         Environment: AWS Linux, Tomcat 8.0.23, Java JDK 1.8.0_45
>            Reporter: Lance Bader
>         Attachments: EntryWithByUnkown.png, PermalinkShowsWho.png, 
> jspwiki.policy
>
>
> Even though the wiki is configured so that only authenticated users and edit 
> or even view pages in the JSPWiki, the WeblogEntryPlugin creates entries 
> where the by line reads _By unknown_.  7 out of 21 entries are shown this 
> way.  If you follow the entry's Permalink, the entry will show _This page was 
> last changed on 29-Feb-2016 18:44 by ..._ with the correct user name.
> I have not been able to pinpoint the scenario that exposes this defect, but I 
> suspect it occurs when the user's Tomcat session expires, the create entry 
> link is clicked, and then they are forced to log in again.  However, there is 
> reason to believe that it occurs if the user has ever been forced to log in 
> after their session expires, even on some unrelated page.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to