In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1117 [In-Portal CMS] Admin Interfaces feature request always 2011-09-07 18:38 2012-07-25 05:32
Dmitry  
alex  
normal  
closed 5.1.1  
fixed  
 
none 5.2.0-B1  
https://groups.google.com/d/topic/in-portal-dev/z1iShTzm-xk/discussion
Added Version Control feature for Sections
3
0001117: Version Control for Sections
There is a need to develop new Version Control system for SMS Sections. This would include Auto-Save and Approval (Public/Decline) system allowing users to manage the content.

See attached interfaces (images).


Actions


1. Each user can have only 1 Draft at a time. Draft is the Revision of the page that he is Editing until he actually saves it.

2. User can "Preview" his Draft at any point - it will open a pop-up (or tab) with a Front-end of that page showing how his Draft will look when published live.

3. User can "Discard" his Draft at any point and it will delete/clear all changes.

4. User can "Save" his Draft and it becomes a Revision:
  a. Revision will become Public right away ONLY if User had Permissions to piblish to Live
  b. Revision will become Pending if User did NOT have Permissions to piblish to Live

5. User can "Load" other Revisions and if has special permissions and "Approve" / "Decline" Pending Revisions submitted by other users.

6. User can "Load" other Revisions and if has special permissions and "Restore" to previous revisions.

7. Any time user start Content Block Editing (clicks on Edit) and pop-up (or modal window) loaded, system will create/update a Draft of this page if there wasn't one already. This is directly related to the Auto-save functionality in that Editing pop-up.
Additional tasks in In-B:

#33461 - Versions Control & Editorial Interfaces
#33701 - Implement "Versions Control & Editorial Interfaces"


Plan of Development / TODO:

1. create PageRevisions table with following fields:
- RevisionId, PageId, RevisionNumber, IsDraft, FromRevisionNumber, CreatedById, CreatedOn, Status

2. add LastRevisionNumber field to Category table (will be set to last pending revision, that was approved OR to last revison, when approval isn't used)

3. add RevisionId, ContentAutoSaved field to PageContent table

4. user can't approve revision, which has PageRevisions.FromRevisionNumber < Category.LastRevisionNumber

5. when viewing 5th page revision, then use this formula to get proper content block to show:
SELECT pc.*
FROM PageContent pc
JOIN PageRevisions pr ON pr.PageId = pc.PageId
WHERE pc.PageId = X AND pc.Num = Z AND ( (pr.RevisionNumber = 5 AND pr.CreatedById = Y AND pr.IsDraft = 1) OR (pr.IsDraft = 0 AND pr.Status = 1) )
ORDER BY pr.RevisionNumber DESC

6. when creating a draft, then copy all page content blocks to it

7. drafts don't have revision number until then are officially saved (IsDraft = 0 -> IsDraft = 1 - generate new revision number)

8. when content block is added (e.g. page design changes), then create it's empty version for all past revisions

9. create following new permissions:
- CATEGORY.REVISION.MODERATE
- CATEGORY.REVISION.ADD
- CATEGORY.REVISION.ADD.PENDING
- CATEGORY.REVISION.HISTORY.VIEW
- CATEGORY.REVISION.HISTORY.REVERT

10. to preview any revision from past you need to have CATEGORY.REVISION.HISTORY.VIEW permissions & pass "revision=N" in url of that page. In this mode any existing drafts won't override given revision number. Also this will force "Browse Mode" to be used, so no editable content blocks.

11. when viewing revision from a history OR own draft, then hide "Publish, Decline" button

12. when viewing revision from a history show "Restore" button

13. clicking on Restore button (only, when user has CATEGORY.REVISION.HISTORY.REVERT permission) will create new revision from currently viewed revision and make it live/pending, based on user permissions

14. display current revision (live or viewed from history) number, author, creation time

15. if user already has a draft, then it will be used instead of creating new draft

16. when content block editor window is opened & auto-save happens, then current editor content is saved into ContentAutoSaved column instead of Content column. This is done so user can click "Cancel" toolbar button and see intact page content from moment he opened content block editing window

17. when user clicks "Save" button in content block editing windows, then do "auto save" + move content from ContentAutoSaved to Content column

18. we need to be able to store N number of Revisions for each Section, number can be configurable (start with 20?). This way when 21th revision is created, then 1st is deleted.

19. reverting to a previous Revision will create a new Revision (basically current/new state of all Content Blocks)

20. clicking on a revision from history will load this revision (then Preview button will view this revision in a popup) if it has CATEGORY.REVISION.HISTORY.REVERT or CATEGORY.REVISION.MODERATE permissions

21. create draft (when missing) when content block is changed, instead of saving changes right to it

---------------------------

What toolbar buttons do:
- "Save" will save the revision but will NOT publish to the site (depending on a permissions)
- "Discard" will permanently delete draft

- "Publish" will publish to the website (when user has permission to do that)
- Deny (will return the revision into the draft state for someone to continue working with - it would be nice to be able to specify a reason for it!)

- "Preview" will show you the preview without saving or publishing (only for drafts)
- "Restore" will restore the currently selected revision and will publish it (depending on permission)

parent of 0001250closed  (1.2.0) Advanced SQL Errors on Demo Content insertion during Installation 
parent of 0001252closed  (1.2.0)alex Simple SQL Errors on Demo Content insertion during Installation 
parent of 0001251closed  (5.2.0)alex Default SQL Errors on Demo Content insertion during Installation 
parent of 0001264closed  (5.2.0)alex In-Portal CMS Content Revision toolbar in Content Mode goes away during page scroll 
parent of 0001274closed  (5.2.0)alex In-Portal CMS Multiple issues with Content Revision Tracking 
related to 0001244closed  (5.2.0)alex In-Portal CMS Content block changes not saved, when switching language in editing window 
jpg Versions_Control_Editorial_Interfaces_3_c.jpg (357,440) 2011-09-07 18:40
http://tracker.in-portal.org/file_download.php?file_id=1126&type=bug
jpg Versions_Control_Editorial_Interfaces_3_a1.jpg (374,510) 2011-09-07 18:40
http://tracker.in-portal.org/file_download.php?file_id=1127&type=bug
jpg Versions_Control_Editorial_Interfaces_3_b1.jpg (384,337) 2011-09-07 18:40
http://tracker.in-portal.org/file_download.php?file_id=1128&type=bug
zip intechnic4_html.zip (895,389) 2011-09-07 18:40
http://tracker.in-portal.org/file_download.php?file_id=1129&type=bug
rar images_v2.rar (24,295) 2011-09-07 18:43
http://tracker.in-portal.org/file_download.php?file_id=1130&type=bug
patch cms_revision_control_feature_v8.patch (98,301) 2011-09-07 18:44
http://tracker.in-portal.org/file_download.php?file_id=1131&type=bug
rar Versions_Control_Editorial_Interfaces_3.rar (443,352) 2011-09-08 09:41
http://tracker.in-portal.org/file_download.php?file_id=1132&type=bug
patch cms_revision_control_feature_520.patch (99,239) 2011-12-08 11:02
http://tracker.in-portal.org/file_download.php?file_id=1363&type=bug
patch page_revision_upgrade_fix.patch (426) 2012-01-06 10:33
http://tracker.in-portal.org/file_download.php?file_id=1469&type=bug
patch setting_to_enable_page_revision_control.patch (12,998) 2012-01-16 10:45
http://tracker.in-portal.org/file_download.php?file_id=1492&type=bug
patch sql_error_on_page_revision_delete.patch (628) 2012-01-17 03:27
http://tracker.in-portal.org/file_download.php?file_id=1494&type=bug
Issue History
2012-07-25 05:32 alex Note Added: 0004989
2012-07-25 05:32 alex Status resolved => closed
2012-05-11 11:27 alex Relationship added parent of 0001274
2012-04-23 11:49 alex Relationship added parent of 0001264
2012-04-06 10:00 Dmitry Relationship added parent of 0001251
2012-04-06 10:00 Dmitry Relationship added parent of 0001252
2012-04-06 09:59 Dmitry Relationship added parent of 0001250
2012-04-03 05:27 alex Relationship replaced related to 0001244
2012-04-03 05:25 alex Relationship added parent of 0001244
2012-01-17 03:29 alex Note Edited: 0004420 bug_revision_view_page.php?bugnote_id=0004420#r965
2012-01-17 03:28 alex Changeset attached 5.2.x r15056
2012-01-17 03:27 alex File Added: sql_error_on_page_revision_delete.patch
2012-01-17 03:27 alex Note Added: 0004420
2012-01-16 10:46 alex Changeset attached 5.2.x r15051
2012-01-16 10:45 alex File Added: setting_to_enable_page_revision_control.patch
2012-01-16 10:45 alex Relationship added related to 0001038
2012-01-06 10:36 alex Changeset attached 5.2.x r15001
2012-01-06 10:34 alex Note Added: 0004396
2012-01-06 10:33 alex File Added: page_revision_upgrade_fix.patch
2011-12-08 11:02 alex File Added: cms_revision_control_feature_520.patch
2011-12-08 11:01 alex Changeset attached 5.2.x r14856
2011-12-08 11:01 alex Note Added: 0004234
2011-12-08 11:01 alex Status needs work => resolved
2011-12-08 11:01 alex Fixed in Version => 5.2.0-B1
2011-12-08 11:01 alex Resolution open => fixed
2011-12-08 11:01 alex Assigned To !COMMUNITY => alex
2011-10-22 05:39 alex Estimate Points => 3
2011-09-26 04:55 alex Time Estimate Added 1
2011-09-23 20:37 Dmitry Note Added: 0003877
2011-09-23 20:37 Dmitry Status needs testing => needs work
2011-09-16 11:12 Dmitry Note Added: 0003754
2011-09-16 11:12 Dmitry Target Version 5.1.3 => 5.2.0
2011-09-08 09:41 Dmitry File Added: Versions_Control_Editorial_Interfaces_3.rar
2011-09-07 18:45 Dmitry Developer Dmitry => alex
2011-09-07 18:44 Dmitry Note Added: 0003726
2011-09-07 18:44 Dmitry Assigned To => !COMMUNITY
2011-09-07 18:44 Dmitry Developer => Dmitry
2011-09-07 18:44 Dmitry Status active => needs testing
2011-09-07 18:44 Dmitry File Added: cms_revision_control_feature_v8.patch
2011-09-07 18:43 Dmitry File Added: images_v2.rar
2011-09-07 18:43 Dmitry Additional Information Updated bug_revision_view_page.php?rev_id=815#r815
2011-09-07 18:40 Dmitry File Added: intechnic4_html.zip
2011-09-07 18:40 Dmitry File Added: Versions_Control_Editorial_Interfaces_3_b1.jpg
2011-09-07 18:40 Dmitry File Added: Versions_Control_Editorial_Interfaces_3_a1.jpg
2011-09-07 18:40 Dmitry File Added: Versions_Control_Editorial_Interfaces_3_c.jpg
2011-09-07 18:38 Dmitry New Issue
2011-09-07 18:38 Dmitry Reference => https://groups.google.com/d/topic/in-portal-dev/z1iShTzm-xk/discussion
2011-09-07 18:38 Dmitry Change Log Message => Added Version Control feature for Sections

Notes
(0003726)
Dmitry   
2011-09-07 18:44   
This task is ready for testing
(0003754)
Dmitry   
2011-09-16 11:12   
Moved back to 5.2.0.
(0003877)
Dmitry   
2011-09-23 20:37   
Needs to be implemented in 5.2.0 (PHP 5 format)
(0004234)
alex   
2011-12-08 11:01   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001117: Version Control for Sections
(0004396)
alex   
2012-01-06 10:34   
Patch "page_revision_upgrade_fix.patch" fixes upgrade script, that created missing PageRevisions for pages, that have content blocks.
(0004420)
alex   
2012-01-17 03:27   
(edited on: 2012-01-17 03:29)
Also noticed, that deleting pages with content blocks results in sql error (while in debug mode). Patch "sql_error_on_page_revision_delete.patch" fixes it.

Where was the problem:
1. when deleting a category, then also all it's sub-items are deleted as well
2. SELECT sql is made to get all details about item being deleted before deleting it
3. SELECT sql for page revisions failed since it used JOIN instead of LEFT JOIN to Categories table record, that was already deleted

(0004989)
alex   
2012-07-25 05:32   
Since 5.2.0 version was released.