copy/pasted straight from a post I made to the drupal-support list:

On Tue, Aug 17, 2004 at 11:57:17AM -0500, Kent Livingston wrote:
> And while we're talking about improvements... There needs to be a warning
> when a user moves away from the new content composition page? I have users
> who accidentally move away from the composition window and their material is
> usually lost. I recommend composing in another editor, but a warning that
> your work will be lost unless you 'submit' might reduce the frustration.

I agree with you there, I think a much better solution would be a "draft"
module, that would allow users to save the node there working on [writing] as a
draft. I guess it could fit in quite nicely with drupal, just setting the status
to 'unpublished' and have a page that would display drafted nodes for the
current user.

I haven't come across any discussion, nor implementations, on the drupal site
about this unless I've missed something?

A few sections on my drupal site usually consist of rather long articles, right now the content creators are working on these in another editor, then pasting them in when they create node. Some of them have requested the ability to save a "working draft" that gets saved in the system (database) but isn't published and is only accessible by them.
In short, the ability to save a node as a draft.

CommentFileSizeAuthor
#2 blog.module-user-draft.patch973 bytes2root4u

Comments

Zen’s picture

Version: » x.y.z
2root4u’s picture

StatusFileSize
new973 bytes

Related to this issue, I have the same need. After looking through the code, it appears that nodes handle their own permissions so I went ahead and implemented this for the blog module. Its a very simple hack. The permissions currently allow you to delete or update your blog entry if you own it. I changed it to also allow you to view it (seems strange that wasn't allowed already). Next, I changed the "My blog" query to allow users to see their own blog entries even if the status is not published. Patch is attached for version 4.6.5.

KiegKhan’s picture

Hello,
The need for draft documents becomes more important when a site is live and there are collaborative teams creating and altering the content. Currently, using 4.7.0beta3 and without any other mods, if I create a document then this is a live document. What this means if the document is changed, then the changes are presented to the web site instantly the document is saved.

I thought about un-publishing the document when it is in draft, but then the document is totally removed from the users view, which is not suitable during the revision process.

What I would think is not too hard is to use the revision system and have a button that will let the editor save the document as draft (ie: creates a new revision) but that the current document is not promoted to the current revision, then when the draft is complete the editor goes to the revision screen and promotes the draft to active.
Thanks.

puregin’s picture

Can you not use the existing roles, permissions and workflow to allow a set of users to create content which by default goes into moderation, is unpublished, but which is still editable by them?

Djun

Kieg Khan’s picture

Thanks for the feedback,

Unfortunately, this is not a true drafting system as the document is then totally unavailable to visitors until you release it from the queue. Imagine having ticket prices for some product you are selling. You want to increase the price, so you unpublish it and make the changes. You did that today because you have the time, but the price does not change until next week. During this time the current ticket price is removed from the system.

You might also think, just create a new node with the new ticket prices. Ok, so I tried that , but I like 4.7.0 and the save as new node option did not work the last time I tried it. As well, there is the other problem. I am using the revision system so that I can see the trend in ticket prices over the past year. Creating a new node each time results in no history, or there is history but it is harder to collate and track. Sure it can be done, but the revision module just does it by default.

So what I am proposing, here and elsewhere, is that the draft document is just a future revision. When the draft is Ok to go live and replace the current content, just hit the Revert button (set active prior to 4.7.0b5). Of course, if this was my ticket price example, then I possibly would not want site visitors to have access to see revisions. I think Taxonomy_access will also help with this as non-permissioned people would not be able to alter the revision either.

The beauty of this method is that it is also supported by the diff module, so any editor could see the differences between the current content and the proposed content.

The main challenge is how to make it happen. You would need to create the revision as per normal, but leave the node.vid unchanged. You would then need to make it so that when anyone edits the node they actually edit the draft node_revisions.vid created, and not the current node.vid version, and also make sure that is a future revision is available that a new revision is then not made again (creating two future revisions).

Not being a programmer, I couldn't do it, but conceptually it sounds pretty straight forward. All the bits are there, they just need to be put together.

Thanks.

chx’s picture

Kieg, I think you missed the 'moderate' feature... isn't that something that you want?

Kieg Khan’s picture

Ok, I am happy to have a look at it. Drupal is pretty complex to me so I probably misunderstood its function. Can you explain in practical terms how to use it/ how it works?
Thanks.

Kieg Khan’s picture

Hello,
I have tried Moderator Queue in Drupal 4.7.0b5 and I could not tell what it was supposed to be doing. I created content with a suitable admin user and checked that it was unpublished and in moderator queue. The content appeared in the content list as unpublished. I could not determine where the moderator queue was located.

I published the document and then went to view it with another user. The document was there, but there was no sight of moderation queue.

Next I published the document with moderator queue. Same as before, document it there, but no sight of any moderator queue options.

Unfortunately, the same problem seems to occur. If the document is unpublished, then nobody can see the document except the admin, who can publish it.

When the document was unpublished, whether in moderation or not, no other user than the admins could see the document.

If I am doing something wrong, please let me know, otherwise, this does not seem to work in 4.7.0b5.
Thanks.

Kieg Khan’s picture

Nope, does not seem to work for me. If the content is unpublished, then it is not visible to site visitors. The moderation queue does not seem to do anything, unless you are the admin, then it can appear in the Admin Menu that there is content in the moderation queue.

Also, has this function changed in 4.7.0? According to the handbook, moderation is a process where site users can vote on content and then that content can be unpublished if the vote gets too low or high.

I do not see how this helps with a draft system, except that you could determine that all user had read the draft, and in that instance you would need a lot more control than just a globally set moderation value.

bradlis7’s picture

I really like this idea! This would be a major feature addition, and a lot of coding and testing would be involved. Since 4.7 is almost ready to be released, I imagine this will not be put into drupal main until 4.8 or later if they decide to do this. It could possibly become a module, but I'm not for sure on that.

Some Implementation Notes
I don't necessarily think this should have diff operations, but rather be like a draft in an email program. It could have similar functionality to gmail, where the draft is automatically saved every 1 minute.

If every draft was saved, it would take up a lot of space, so I think it should be deleted upon being published, or so many days after being published.

Kieg Khan’s picture

Thanks Bradlis7,
This issue seems to have been going around for a pretty long time. I found this post which is about the most interesting development so far, but I am yet to test,

Node/48731

For me personally, I am really just interested in being able to draft content that is going to have version control applied to it, so I thought the easiest way to start would be to work with the already good revision module.

In your idea, you could draft anything, but again, I think it would be easily solved with the revision module, just have the option to not keep revisions. What this would do is cause the previous revision to be discarded once it is promoted to the current document (or in Drupal speak, once it is Set Active or Reverted).

I will take a look at the above link and see if it gives me enough to work with. Most of my investigation leads me to think this could be achieved quite easily and is widely sought after.

More capable permissions and taxonomy handling could be handled in a future Drupal, but I think a fair majority of users would be happy just to be able to draft documents before commiting them to the published state.
Thanks.

LAsan’s picture

Version: x.y.z » 7.x-dev
webchick’s picture

Marked #201749: Draft functionality and #120926: Poor man's draft functionality duplicates of this issue (oldie!)

stevector’s picture

Status: Active » Closed (duplicate)