Closed (fixed)
Project:
Draft
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2009 at 13:05 UTC
Updated:
25 Mar 2009 at 21:36 UTC
Hi,
How hard is it to make it so the draft is not deleted. Reason is there is another feature request for the STORM module where we'd like to 'clone' related nodes changing one field. It might be a bit of time before that happens, so this would be a great in-the-meantime feature to have for STORM projects and project tasks.
STORM is a project management set of modules.
Cheers
Chris
Comments
Comment #1
cstachris commentedhttp://drupal.org/node/345304
Here is what I mean.
Comment #2
bsimon commentedDraft doesn't automatically delete the drafts- it's actually a minor problem that you can end up with hundreds of old draft copies in the db. :/Draft does overwrite autosaved copies with newer versions of the same node, I think, so you shouldn't get multiple drafts of the same article at different stages of development (unless you copy and paste the content into a new editor form or something like that)
Edit: Sorry, I was wrong about this. Draft does delete the drafts in normal situations (when the node is saved, I think). The reason for all the old draft copies is probably windows that have been closed without clicking the save button.
Comment #3
nquocbao commentedTry the version here: http://drupal.org/node/368030
This version implement a cron to delete all empty draft.
Comment #4
bsimon commentedLook at the file draft.module and the section titled '* Submission handler for when the node is submitted' (around line 190).
I would guess that db_query("DELETE FROM {drafts} WHERE draft_id = %d", $form_state['values']['draft_id']); is the part which actually deletes the draft from the DB.
So maybe you can just remove that ?
note: the code after that section (such as '* Form submit handler....' etc) handles the user manually deleting drafts
Comment #5
nquocbao commentedHmmm, it's reasonable to remove draft after the node is saved. The draft may confused user.
So what is your trouble actually ?
Comment #6
bsimon commentedAccording to the link, they want to know if they can use the Draft module to copy content in the Storm module. That's why they want to keep all the drafts.
Whether it can easily be made to work probably depends on how Storm implements/links its data structures (Draft can handle CCK-created custom content types and fields, I think, though I've never tried that)
Comment #7
cstachris commentedbsimon, thanks for your February 7, 2009 - 21:41 post.
I'll look into it when I have more time, which should be a few days away.
Comment #8
darren.ferguson commentedThis has now been incorporated into the draft module. The administration screen has a check box which if they check will force the system not to remove any drafts using cron. By default the module will remove the drafts via cron.
Comment #9
darren.ferguson commented