Description
If you edit an underlay page, it will be saved to the underlay dir and not the data dir.
Steps to reproduce
- Edit an underlay page in the wiki for the first time
- The page is correctly copied to the data dir
- Delete the page
- The copied page is set to deleted state by pointing current to the next revision.
- Edit same underlay page again
- The second edit is saved in the underlay page, not in the standard page.
Since the underlay page is immutable, and always contain only revision 1, the correct behavior should be to create a new revision in the standard page.
Examaple
See http://moinmoin.wikiwikiweb.de/HelpContents?action=info
I made revision number 8 while editing from this wiki, not from MoinMaster! In the data dir of this wiki you will find a deleted copy of HelpContents.
Details
MoinMoin Version |
1.3.2 dev |
OS and Version |
All |
Python Version |
2.4, 2.3 |
Server Setup |
All |
Workaround
Delete the edit-log from the underlay page, and move the new revision to the standard page by hand, renaming to the next revision number.
Discussion
This is critical - if underlay is not read only, there is no point to have it. Wiki admin should be able to replace his underlay dir with new copy without loosing any data!
Reopen because copy-on-write works only on the first time.
This is the fix - I'm not committing this since I still did not check this with current code, but its working in my workdir (patch-538+ page state refactoring).
--- current/MoinMoin/PageEditor.py 2005-01-10 19:21:13.000000000 +0200 +++ main/MoinMoin/PageEditor.py 2005-01-16 06:19:34.000000000 +0200 @@ -759,14 +759,23 @@ self.copypage() - pagedir = self.getPagePath(check_create=0) + # Write always on the standard directory, never change the + # underlay directory copy! + pagedir = self.getPagePath(use_underlay=0, check_create=0) + revdir = os.path.join(pagedir, 'revisions') cfn = os.path.join(pagedir,'current') clfn = os.path.join(pagedir,'current-locked') - + # !!! these log objects MUST be created outside the locked area !!! + + # The local log should be the standard edit log, not the + # underlay copy log! + pagelog = self.getPagePath('edit-log', use_underlay=0, isfile=1) + llog = editlog.EditLog(self.request, filename=pagelog, + uid_override=self.uid_override) + # Open the global log glog = editlog.EditLog(self.request, uid_override=self.uid_override) - llog = editlog.EditLog(self.request, rootpagename=self.page_name, uid_override=self.uid_override) if not os.path.exists(pagedir): # new page, create and init pagedir os.mkdir(pagedir)
Plan
- Priority: High
Assigned to: ThomasWaldmann
- Status: fixed in patch-552 (using the patch above).