Because the WYSIWYG view of my custom CMS is not perfect (using tinyMCE), it's useful for users to have an open window of the page being worked on, which they refresh in order to view changes after they are submitted to the MySQL database.
Unfortunately, they can't undo a change once it is submitted. MySQL ROLLBACK and savestate don't seem to be the solution because they don't update the table until COMMIT, so the user doesn't see the change reflected in the open page window.
This must be an issue someone has found a solution for. Does anyone know?
ROLLBACK for CMS changes
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: ROLLBACK for CMS changes
Why not just store the previous versions (up to a certain number)? And allow them to specify the revision they want to revert back to.
Re: ROLLBACK for CMS changes
Yes, that's the idea I'm looking for. Would you suggest doing that in the database or by saving the array of variables somehow with PHP? If in the database, then that's what I first thought rollback would provide.
Re: ROLLBACK for CMS changes
On my CMS, I use a field called "Type" which is an enum('LIVE','ARCHIVE','DRAFT') LIVE has only have one copy the actual copy viewsers see, DRAFT can have ONE copy that allows people to be actively working on changes, and they can give a specific URL to others to review it, ARCHIVE can have up to 10 copies which are auto made from the previous LIVE copy each time a new save is made.
-Greg
-Greg
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: ROLLBACK for CMS changes
Rollbacks are meant to roll back data from a transaction, not from any point in history.rhecker wrote:Yes, that's the idea I'm looking for. Would you suggest doing that in the database or by saving the array of variables somehow with PHP? If in the database, then that's what I first thought rollback would provide.
Every time they have a new copy to be saved, create a new record in your "history" table and update the latest revision id to their user table.
Then when they want to "revert" back to a previous version, you can present all the different revisions and allow them to choose and/or implement back/forward functionality.
Re: ROLLBACK for CMS changes
Thanks for the ideas. I can implement something like this easily enough.