[development] Use revisions to replace previews

Kevin Reynen kreynen at gmail.com
Fri Jun 8 16:59:39 UTC 2007


Is preview int per user?

You start a preview, but don't commit it and I want to modify that node...

Am I informed that the node is being edited?
Can I see the edit?
If I can edit it regardless of another user's unsaved preview, is that
preview deleted?

"If so, find the latest revision where preview = 1 and replace
its contents with the current post's contents."

Is that per user or will my edit overwrite your preview?

"user comes back after browser crashes:"

How does a non admin user get "back" to node that has been previewed (and
thus saved to the db) but never published if they don't know the nid?   This
is my "self serve" UI issue.  Anyone how has dealt with a user who wants to
recover autosaved versions of a Word doc that they never saved knows that
this is possible, but a pain.  Users have to be able to get back to their
work in progress on there own.

I see a solution alerting users to a unsaved preview when editing existing
nodes, but how do you get to a node that has been previewed but never
saved?  I'm thinking about forums where a new users will occasionally
preview their posts, but never realize there is another step to submit
them.  Now they are just gone.  This change will leave them in the db, but
I'm not sure that's an improvement if I'm the only person who can recover
that post.

- Kevin

On 6/8/07, Angela Byron <drupal-devel at webchick.net> wrote:
>
>
> On 8-Jun-07, at 12:21 PM, Morbus Iff wrote:
>
> >>> This is pretty much the way I work - I could easily spend 30
> >>> previews before I finish what I consider my first draft of a
> >>> node.  I would hate to waste 30 revisions (and the overhead) for
> >>> stuff
> >> That's why it was suggested to automatically delete revisions
> >> that  were used for previews. Not that it would become elegant
> >> code, but  that would at least get rid of the overhead.
> >
> > How does that reduce the overhead, or keep the revision counter
> > from ballooning ridiculously? I'm still "wasting" the revisions,
> > whether they're active or not.
>
> Proposal:
> new field in node_revisions: preview int 1
> all nodes default to status = 0.
>
> When preview is clicked...
> - Does a node id exist for this post yet?
>    - If so, find the latest revision where preview = 1 and replace
> its contents with the current post's contents. Also store the node ID
> in a cookie value, so if the browser crashes, we can get back here.
>    - If not, create a new revision and mark it preview = 1;
>
> When submit is clicked...
> - Create a new "normal" revision (preview = 0).
> - Publish the node (workflow settings permitting)
> - Delete preview revision if it exists.
> - Delete node ID cookie value.
>
> hook_cron
> - Delete all preview = 1 revisions where updated >= variable_get
> ('preview_threshold', 86400);
>
> user comes back after browser crashes:
> - Drupal checks for existence of  node ID cookie value, does a
> drupal_goto() to the node "would you like to finish editing this?"
> Since users can see unpublished nodes as long as they've authored
> them, they'd be able to further edit the content.
>
> -Angie
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070608/c1840774/attachment.htm 


More information about the development mailing list