[development] SoC 2007 idea - Drupal undo function

Allister Beharry allister.beharry at gmail.com
Tue Mar 20 20:56:31 UTC 2007

Hi all,
Sorry for 'idea-spamming' you guys, but I want to send in my two
applications before the 21st.
Anyway, one of my favourite things about the Plone CMS is its undo
capability. For just about every content and configuration change you
can undo changes with one click. Plone is built on the Zope framework
and the Zope object db which is inherently transactional and can
rollback any change made by an object seamlessly and cleanly, as long
as no further operations were made after the operation you want to
undo. I was reminded about how cool this was today when a fellow web
team developer contacted me because she had introduced a bug in our
Drupal theme that seemed to defy fixing short of pulling out the old
page.tpl.php and replacing the current one on the server

Anyway, my idea is for an undo module exposing hooks that modules can
use to register database scripts and file operation scripts that could
be used to rollback a module operation.

Suppose I have a node type called audiofile - everytime an audiofile
node is created or
updated, it could generate a line of SQL code that could be run to
revert the INSERTs or UPDATEs which generated or updated the node .
This would be registered through the undo module and the code could be
stored in an Undo table, including details on the date/time of the
operations and an interface could be written which allowed the node
content to be rolled back to its previous state Of course undoing an
action in Drupal can be complex or impossible in some cases and can
screw up ancillary functionality like security if the user defines
something node-specific and then removes that node. But for simple
additions and updates to nodes, an undo function could be quite
useful. The same idea could be extended to operations involving
modifying files like theme operations; this would be more complex as
it would involve storing old files or possibly file diffs. Obviously
This idea needs a lot of fleshing out but what do you guys think about
the overall concept? Thanks again


More information about the development mailing list