Issue Details (XML | Word | Printable)

Key: XWIKI-1468
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Artem Melentev
Reporter: Carlos Pruitt
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XWiki Core

History page version and normal page version do not match

Created: 10/Jul/07 12:00   Updated: 11/Mar/08 03:48
Component/s: Core
Affects Version/s: 1.0
Fix Version/s: 1.1 M4

File Attachments: 1. File fixrcs.groovy (0.5 kB)
2. File FixRCS.xar (1 kB)
3. File fixrcs.xar (1 kB)
4. File Main.fixrcs-r1.xwikipage (0.9 kB)
5. Text File XWIKI-1468-B.patch (29 kB)
6. Text File XWIKI-1468-resaveapi-amelentev.patch (6 kB)
7. Text File XWIKI-1468.patch (1 kB)

Environment:
Window XP with IE
Linux Ubuntu Feisty with Firefox
Issue Links:
Dependency
 

keywords: History, version
Date of First Response: 28/Jul/07 18:21
Resolution Date: 12/Aug/07 20:38


 Description  « Hide
I am using xwiki-1.1-milestone-2.3619.
I just verified the same bug in 1.1-milestone-3.3909.

When I Show --> History, it does not
show a corresponding version.

Example:

Newly created page with 3 different edits.

Edit 1
Version 1.2 last modified by Administrator on 09/07/2007 at 09:41

Edit 2
Version 1.3 last modified by Administrator on 09/07/2007 at 09:42

Edit 3
Version 1.4 last modified by Administrator on 09/07/2007 at 09:44

Show --> History

1.3 Administrator 09/07/2007 09:44 Rollback
1.2 Administrator 09/07/2007 09:42 Rollback
1.1 Administrator 09/07/2007 09:41 Rollback

When I select "From" on Version 1.3 and "To" for 1.1.

changes
From Version 1.4 To 1.2 edited by Administrator on 2007/07/09 09:41

<green color bar>Edit 1
< red color bar>Edit 3



 All   Comments   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Ludovic Dubost added a comment - 28/Jul/07 18:21
I confirm this problem.. I'm currently looking at improving the diffs and stepped on this issue.

It is annoying because It's not so easy to fix. The source problem is that the version field in the XWikiDocument object and the versions in the RCS file to not match (there is 1 version difference). This is why the display in the history page does not show the last versions.

We can fix the display part but this would be acknowledging the issue in the version file. If we try to fix the source problem we might have part of the documents with the issue and part of the documents without it.

I think we need to fix the source issue and also migrate the versions inside the version file. We can detect documents that are not migrated by the fact that the last version in the RCS file does not match the version in the current XWikiDocument.


Ludovic Dubost added a comment - 29/Jul/07 12:41
Patch for the core issue that creates a document with the wrong initial version.
Another patch is needed to migrate existing data and/or fix the screens/functions impacted by this issue

Ludovic Dubost added a comment - 30/Jul/07 22:46
Patch to fix the versioning issue. This patch will detect that the RCS file is not in sync with the latest document version and update the RCS file transparently.
This is not expensive and is called in the few functions where this is needed for the UI to present correct data.
We can also write an update script in the wiki to fix all documents at once

Artem Melentev added a comment - 07/Aug/07 23:33
fixed in r4119.
Need import&export to affect.
Remained issue:
Latest doc version may be not sync with rcs, until next save.
I think this issue is not too important for now. For this issue migration system is needed.
Tell me if something wrong.

Artem Melentev added a comment - 10/Aug/07 14:05
my changes rollbacked.
but Ludovic's partial fix stay in the trunk, so will be in 1.1M4

Artem Melentev added a comment - 10/Aug/07 21:08
Need we apply XWIKI-1468-B.patch in 1.1M4 for close this issue? Or partial fix is enough?
Or move this issue to 1.2M1?

Catalin Hritcu added a comment - 11/Aug/07 18:24
Could this also be causing this bug http://jira.xwiki.org/jira/browse/XWIKI-1582 ?

Artem Melentev added a comment - 11/Aug/07 23:03
XWIKI-1468-resaveapi-amelentev.patch - sample modification of XWIKI-1468-B.patch for using in external script
Reconstruct doc.version history from scratch (use fromXML/toXML, setversion).

Artem Melentev added a comment - 11/Aug/07 23:06
sample migration script for XWIKI-1468-resaveapi-amelentev.patch

Artem Melentev added a comment - 12/Aug/07 20:15
resave api for migration is added in r4204

Artem Melentev added a comment - 12/Aug/07 20:27
Main.fixrcs-r1.xwikipage - final migration script for this issue.
It need be saved as standard xwiki page (for example Main.fixrcs page) and executed by click on link.
We need write about it in 1.1M4 Reliase Notes.

Artem Melentev added a comment - 12/Aug/07 20:36
attached fixrcs.xar - xwiki archive with Main.fixrcs-r1.xwikipage
It is easyer for user.

Vincent Massol added a comment - 13/Aug/07 10:21
Artem, shouldn't the fixrcs page be located in the XWiki space (our admin space)?

If you're ok with this, could you recreate a XAR? At the same time, could you rename the page from fixrcs to FixRCS?

Thanks


Vincent Massol added a comment - 13/Aug/07 10:24
Is Fix RCS required on the standalone version or is it only required for users who upgrade from an existing version?

Vincent Massol added a comment - 13/Aug/07 10:29
Some typos in the fixrcs page:
  • "Starting rix rcs" --> "Executing the RCS fix..."
  • "done" --> "Done"

Artem Melentev added a comment - 13/Aug/07 10:34
FixRCS is requred only for users who upgrade from <1.1M4.

Artem Melentev added a comment - 13/Aug/07 10:40
correction: FixRCS is requred only for users who WANT to sync version in documents and its archive. ~1.1M1-1.1M3 affected this sync out.

Vincent Massol added a comment - 13/Aug/07 10:49

Artem Melentev added a comment - 13/Aug/07 11:30
Attached FixRCS.xar with fix all remarks.