The modules:
CCK
workflow
workflow_access
actions
node clone
The problem:
I have a workflow for a CCK node type that includes a "Live" state. When a node is "live," it cannot be edited (I've configured it thus with workflow_access). I want to permit my users to apply updates to these documents in the following steps:
- When the user wants to submit updates for a live document, a copy of the node is created. The user becomes the author of the new node as usual, but the node "remembers" the nid of the original in a hidden field.
- The user applies her updates to the document and submits it for review (which my current workflow does).
- When an admin makes the clone live--this is the tricky part--it automatically overwrites the original. The live node retains the nid, path, and taxonomy as the original, but the title and content fields are replaced by those of the submitted clone, and the revision and workflow history of the clone are appended to the original's.
Somehow, the copy needs to "remember" the parent's node id, and somehow, it needs to trigger the special update process when it goes live. Any advice on how to proceed? I'm an experienced PHP coder, but the Drupal API is foreign country. I want to develop this functionality the "right" way, so that it's not going to break everything the next time I need to apply an update or patch.
Comments
two tasks
I think I actually have two separate tasks here: a hook on clone that saves the nid of the original to the clone's original_id field (or in a table of nids with original_ids), and an action that does all this updating and appending. Advice on either is appreciated.
=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE
Exactly what my client needs
This would be ideal for my client too - the content being edited/updated needs to remain available to the public in its unedited state until the editor or admin chooses to replace it with the new version. We don't want in-progress versions to be publicly visible.
I guess you never got anywhere with it?
.
Actually three weeks after I made that post the whole project was scrapped (it was the victim of some terrible project management) and I got laid off. I relied on node revisioning and perhaps a comptued field containing the parent's nid, I think, but I can't remember if I completed the functionality. A whole lot of improvements have been made to the Drupal API since Drupal 4.7 and there's a lot more contrib functionality available.
Maybe one of these modules would be useful:
http://drupal.org/project/draft
http://drupal.org/project/save_as_draft
If not, one could probably cobble something together from Clone, Workflow, Computed Fields, and Workflow-ng, or write a mini-module dependent on some of these to handle the node create/update hooks.