Drupal "save as draft" feature

Recently the Poorhouse wanted some sort of "Save as draft" facility, such that a (fabulous) article could be started at one point in time, saved - without being published - and continued some other time. Also the option to decide whether to publish to the front page or not on a case-by-case basis was desired - after all you don't want every last bit of the inner workings of your mind highlighted for all to see. At least make them work for it.

Drupal contains this feature, under "Publishing options". However, this is only available to the initial admin user, plus anyone who has node edit privileges. The Poorhouse wanted its guest authors it have this facility too. However giving them node edit privileges was not quite right, because it meant they could edit, delete and otherwise have finger-slips over everyone's articles and not just their own.

After a bit of helpful advice from others and much trial and error (the only worthwhile computer strategy as far as we can tell) it seemed impossible on its own. However, with the addition of a module called Workflow, it did indeed become possible. Before installing Workflow, you should install the Actions module, as it uses components of that to do its magic. Install, enable and configure Actions module so it generates the default actions, as that is all the actions you need to do this. You also seem to need to make sure that all the users you want to be able to use this facility are in a group, called for instance "writers". You shouldn't need to do this as far as the documentation says, but it is the only way we got it to work at present.

Then install and enable Workflow, and go into its configuration screen (Administer >> Workflow).

After installing Workflow, 3 states were set up. You can call them anything, but the Poorhouse chose:

  • On front page
  • Published
  • Save as draft

Then a new workflow was set up, inspiringly called Draft-Publish-Front page. This workflow was assigned to the Story node type, but could be assigned to any or all you may have.

On this "Edit workflow" screen, tick the boxes such that all the people in your group "Writers" can go from and to any state from any other.

Then go back and choose the actions for the workflow; each transition ticked on the previous screen should be available. The actions of relevance here are:

  • Publish node
  • Unpublish node
  • Promote node to front page
  • Remove node from front page

For each transition use both the relevant actions. For instance, for the "Save as Draft -> On front page" transition, add "Publish Node" and "Promote node to front page". The Poorhouse found it worked slightly more reliably if you always chose the two relevant options even if they should be unnecessary. For instance on the "On front page -> Published", we assigned both "Remove node from front page" and "Publish node", even though it is obviously published already. It doesn't do any harm, and it helped during the testing period. It is probably unnecessary once it's all up and working though if your resources are ridiculously low that 2 such operations will cause a server crash...

The (creation) state is the node first being published. So to do the "(creation) -> Save as Draft) we picked to assign "Remove node from front page" and "Unpublish node").

New workflow optionsNew workflow optionsJob done! Mostly. Users can now do saving as draft - but if they do this, they can't access it and unless they manage to work out the edit page address when they come back to it, it's kind of lost. A user interface needs implementing - and the Workspace module provides a fine example.

There are a couple of quirks in our install that you wouldn't expect to see if these features were in Drupal core. For instance, after saving as draft a user gets a "You are not allowed to see this page" type error, as after all it isn't published. To get back to it, just view your workspace and hit edit on the correct file. However, it certainly provides a workable system in the mean time.


"unless they manage to work out the edit page address"

The workspace module (http://drupal.org/project/workspace/) should help you with that. It creates a link in the navigation where users can find content they have created. It would show them their unpublished drafts.



Thanks for the tip - workspace does indeed do exactly what I wanted! At first it had problems because the site used to be hosted on an rather ancient mysql installation, but they were at least fixable enough to be useful. And when you upgrade to mysql 4+ it works great out of the box. Thoroughly recommended.

what about Drupal 6?

how could this be done in Drupal 6. I've been looking at a "Save as Draft" functionality for ever. The action and workflow module are part of D6 now, right?

Thanks for the article.

Hi - I don't see why this

Hi - I don't see why this wouldn't work. To be honest, I've not done any serious Drupal stuff for ages now, but I see that both those modules are available for D6 in at least some state:

Alternatively I see someone has come up with a module specifically for "save as draft" - check out http://drupal.org/project/save_as_draft if you haven't already seen it. It's just for D5 at present, but if you check the "pending issues" section of the module, it looks like work has at least begun on it.

Good luck!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <del> <p>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You may use [acidfree:xx] tags to display acidfree videos or images inline.
  • Images can be added to this post.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
12 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.