# Editing shared draft shows an old version of the page

#### お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

# 問題

When Collaborative Editing is enabled, editing a page appears to display an old version of the page as the Shared Draft instead of the most recently published version of that page. This can result in changes being made to an old version of the page and then published as the live page.

# 原因

At the database level, the contents of the Shared Draft is a copy of the old version of the page.

The scenarios described in CONFSERVER-57458 - Getting issue details... STATUS and in  CONFSERVER-58270 - Getting issue details... STATUS are a way of hitting this problem. We still don't have a full visibility of other scenarios that may trigger it.

# 診断

### Diagnosis 1

Visually, you are able to identify the difference on the Shared Draft is vastly different to the latest Published copy of the page.

### Diagnosis 2

If there are subtle changes in the front end, we can try to inspect the database to check whether the saved draft is actually a copy of an old draft version of the page.

1. Grab the Confluence page ID from the published page we wish to delete the draft from:
1. Navigate to the published page in Confluence
2. Hover over the Edit button (but do not click on it)
3. In the URL status bar, you will see something like http://localhost:8090/pages/editpage.action?pageId=123456
4. Keep note of the above pageId (i.e. 123456) for the below database SQL
2. Run the following SQL to retrieve all published versions of the page and the active shared draft:

select * from CONTENT where contentid = <published_pageid> or prevver=<published_pageid>;
select * FROM BODYCONTENT where contentid in (select contentid from CONTENT where contentid = <published_pageid> or prevver=<published_pageid>);

1. This is a sample set of the result set that came back in my local instance for my test pageId 128713064:

CONTENT:

contentidcontenttypehibernateversiontitlelowertitleVERSION (バージョン)creatorcreationdatelastmodiferlastmoddateprevvercontent_status
128713069ページ35My Test Pagemy test page1ff8080004abc958b014ghi002jk100002016-12-20 17:06:54.096ff8080004abc958b014ghi002jk100002017-01-03 08:02:44.538128713064下書き
128713071ページ16My Test Pagemy test page1ff8080004abc958b014ghi002jk100002016-12-20 17:01:02.694ff8080004abc958b014ghi002jk100002016-12-20 17:06:50.41128713064current
152438586ページ28My Test Pagemy test page4ff8080004abc958b014ghi002jk100002016-12-20 17:01:02.694ff8080004abc958b014ghi002jk100002017-01-03 08:02:44.547128713064current
128713064ページ60My Test Pagemy test page17ff8080004abc958b014ghi002jk100002016-12-20 17:01:02.694ff8080004abc958b014ghi002jk100002018-02-05 15:20:12.06
current

-  Content Id 128713069 (yellow row): This is the shared draft row and there should only be one content_status='draft' row.
-  Content Id 128713064 (green row): This is the active published page row and there should only be one row that has content_status='current' and prevver=null for this page.
- The above remaining rows (white rows) are the historic published page versions.

BODYCONTENT:

bodycontentidbodycontentid
128843932<p class=""auto-cursor-target"">hello world 123<br /></p>128713069
128843933<p class=""auto-cursor-target"">hello world 123<br /></p>128713071
152471012<p class=""auto-cursor-target"">hello world 456<br /></p>152438586
128843929<p class=""auto-cursor-target"">hello world 888<br /></p>128713064
2. From the above BODYCONTENT results, assuming there were no changes to the draft, we expected the BODYCONTENT.body for row bodycontentid 128843932 (i.e. the shared draft) to be the same as the BODYCONTENT.body for row bodycontentid 128843929 (i.e. the latest published page) - which it isn't

3. If we then compare the BODYCONTENT.body with the other BODYCONTENT rows, we find that it is an exact match of bodycontentid 128843933
4. BODYCONTENT.bodycontentid 128843933 has contentid 128713071 and jumping back to CONTENT.contentid=128713071, this belongs to a hibernateversion 16 which was last modified on 2016-12-20 17:06:50.41!
5. In this specific example, we clearly can see that the shared draft is a copy of an old version of the page

In some cases, in step 2 (c) above, it may not be an exact match if the user had already made significant changes to the draft page. We therefore search for random snippets of BODYCONTENT.body to see how much of the draft page matches to another older draft to identify if the draft was indeed modified from an old draft rather than the latest published page.

# 回避策

### Workaround 1 - Disable Collaborative Editing

Disabling Collaborative Editing is the fastest temporary work around to ensure only the latest copy of the published page is presented as the editing draft.

• Navigate to Confluence Administration » Collaborative Editing » Disable Collaborative Editing

Note that turning Collaborative Editing off and on does not fix the problem - re-enabling Collaborative Editing could still bring back the old version of the shared draft.

### Work around 2 - Upgrade to Confluence 6.9

Confluence 6.9 introduced the ability to Revert to last published version:

Based on your feedback, we've made some changes to the editor footer. A new ellipsis () menu gives you the option to:

• ページのプレビュー
• ページが最後に公開されたあとのすべての変更を表示
• 最後に公開されたバージョンに戻る
• ページが未公開の場合は、ページの削除

• Upgrade to Confluence 6.9 to provide end users the ability to revert to last published page.
• As always, please test the upgrade in a Staging Environment before applying the upgrade to Production.

However, users still need to be aware that the page they have edited pulled back an old version of the page.

### Workaround 3 - Purge the shared draft for a single page from the database

This work around purges the Shared Draft for a single page so editing that one page will create a new Shared draft based on the latest published copy of that page. This work around will need to be applied to each individual page that you wish to purge the shared draft.

1. Grab the Confluence page ID from the published page we wish to delete the draft from:
1. Navigate to the published page in Confluence
2. Hover over the Edit button (but do not click on it)
3. In the URL status bar, you will see something like http://localhost:8090/pages/editpage.action?pageId=nnnnnn
4. Keep note of the above pageId (i.e. nnnnnn) for the below database SQL
2. Navigate to Confluence Administration » General Configuration » Collaborative Editing » Disable Collaborative Editing
3. Confluence をシャットダウンします。
4.  Backup the Confluence Database
5. Run the following SQL to purge out the draft for a single page:

Substitute <PAGEID> with the above Page ID
delete from CONFANCESTORS;

delete from CONTENTPROPERTIES where CONTENTID in (select CONTENTID from CONTENT where contenttype = 'PAGE' and content_status = 'draft' and title is not null and prevver is not null and prevver = <PAGEID>);

delete from USERCONTENT_RELATION where targetcontentid in (select CONTENTID from CONTENT where contenttype = 'PAGE' and content_status = 'draft' and title is not null and prevver is not null and prevver = <PAGEID>);

delete from BODYCONTENT where contentid in (select CONTENTID from CONTENT where contenttype = 'PAGE' and content_status = 'draft' and title is not null and prevver is not null and prevver = <PAGEID>);

delete FROM links where contentid in (select CONTENTID from CONTENT where contenttype = 'PAGE' and content_status = 'draft' and title is not null and prevver is not null and prevver = <PAGEID>);

delete from CONTENT where contentid in (select CONTENTID from CONTENT where contenttype = 'PAGE' and content_status = 'draft' and title is not null and prevver is not null and prevver = <PAGEID>);

TRUNCATE TABLE "EVENTS";
TRUNCATE TABLE "SNAPSHOTS";
TRUNCATE TABLE "SECRETS";
6. Start up Confluence
7. Rebuild the Ancestor Table
8. Rebuild the search indexes
9. Navigate to Confluence Administration » General Configuration » Collaborative Editing » Enable Collaborative Editing
10. Check that Editing the affected page now brings back the latest version

### Workaround 4 - Purge ALL the shared drafts from the database

This work around is the best permanent fix and will restore confidence that editing any page will create a new Shared Draft based on the latest published copy of pages.

1. Ask users to save any content of the draft they wish to keep into a temporary document
2. Follow the instructions at How to remove all shared drafts and start with a clean slate using Collaborative Editing

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する