Problem

Installed AutoSave for Drupal 7 version. It does not work with the WorkBench Moderation feature. In other words, it does not create a new draft of a published edition.

Comments

hyperglide’s picture

any thoughts on this issue? complexity or steps to start writing a patch?

agentrickard’s picture

Category: bug » feature

It shouldn't be creating a new revision, because it isn't actually submitting the form. It's just saving the status of the data. That means that autosave doesn't actually touch the {node} or {node_revisions} table, which would require integration with moderation. New revision creation should only happen when you actually hit "save".

I don't believe this behavior can be changed easily. What you would have to do for a patch is to change the save behavior in autosave_save() to write a new node revision, not to store to the {autosaved_forms} table.

I believe that behavior is not desirable. Imagine this scenario: We autosave every 60 seconds. User starts editing a form. Walks away for 20 minutes with browser open. Boom, you have 20 new drafts that are all useless.

hyperglide’s picture

Agree the behavior is not desirable.
If autosave is not touching the {node} or {node_revision} table then where is the data stored?

It does seems a good sign that nothing is being save until the "submit" button is pressed.

I believe the underlining issue here is the module when installed and enabled does not currently function if workbench is also enabled and configured.

agentrickard’s picture

Look in {autosave_forms}. Please be more specific about "does not function". What behavior do you expect? What behavior do you observe?

hyperglide’s picture

What was observed:

1 - loaded autosave and enabled the module.
2 - enabled autosave on an existing content type that uses workbench. (created a node) & (edited the node) autosave popup never showed.
3 - created a new content type called did not enable moderation but did enable autosave.
4 - created a new node for the new content type and the autosave blue bar showed on the bottom.

Keeping an eye on {autosave_forms} the first entry was written when step 4 was occurring.

What more can I share to help?

agentrickard’s picture

Category: feature » bug

Got it. So #2 is the issue. When moderation is enabled, the pop-up never fires. This might have to change queues.

tallsimon’s picture

Perhaps it could work by adding a new revision and then updating that auto-revision, rather than keeping creating more revisions.
http://drupal.org/node/1459324#comment-6849408

hyperglide’s picture

Title: Does not Work with WorkBench Moderation » Autosave Module Does not Work with WorkBench Moderation Module
Crell’s picture

Status: Active » Postponed (maintainer needs more info)

I am not able to replicate this.

I am running Workbench Moderation 1.3, and the latest 2.x branch of autosave. I set page nodes to use both autosave and workbench moderation.

Created a page node and typed some stuff. Waited 10 seconds, and the autosave message appeared. Saved node.
Updated page node, typed more stuff. Waited 10 seconds, and the autosave message appeared. Saved node.
Moderated node from Draft to Needs Review. Repeated the process. Still go the autosave message.

HyperGlide, can you verify the versions you're using? I tried this with the 2.0 release of autosave as well as the 2.x-dev, and it worked both times. Maybe verify the time you're waiting for autosave to kick in?