On Apr 17, 2010, at 3:47 AM, sdumitriu (SVN) wrote:

> Author: sdumitriu
> Date: 2010-04-17 03:47:52 +0200 (Sat, 17 Apr 2010)
> New Revision: 28419
> 
> Modified:
>   
> platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
> Log:
> XWIKI-5121: Weird behavior when deleting the head of the history of a renamed 
> document
> Fixed.
> 
> Modified: 
> platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
> ===================================================================
> --- 
> platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
>   2010-04-17 01:23:30 UTC (rev 28418)
> +++ 
> platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
>   2010-04-17 01:47:52 UTC (rev 28419)
> @@ -73,6 +73,10 @@
>                 // If we delete the most recent (current) version, then 
> rollback to latest undeleted version.
>                 if (!tdoc.getRCSVersion().equals(archive.getLatestVersion())) 
> {
>                     XWikiDocument newdoc = 
> archive.loadDocument(archive.getLatestVersion(), context);
> +                    // Reset the document reference, since the one taken 
> from the archive might be wrong (old name from
> +                    // before a rename)
> +                    newdoc.setDocumentReference(tdoc.getDocumentReference());
> +                    newdoc.setMetaDataDirty(false);
>                     context.getWiki().getStore().saveXWikiDoc(newdoc, 
> context);
>                     context.setDoc(newdoc);
>                 }

hmmm... when a doc is renamed, if we restore a version before the rename, 
shouldn't we get back the old, not renamed, document?

Thanks
-Vincent

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to