My current set up is Drupal 5.5 with workflow, actions and revision_moderation.

The "page" content type doesn't have any of the "default options" (published, etc) set.

When a node transitions to the "published" workflow state, it fires the "action_revision_moderation_enable" action.

The action includes the following

      // Also enable "Create new revisions" option, in case it isn't yet.
      $node->revision = 1;

This doesn't seem to work. If I return to the node and edit it, the "Create new revision" flag is not set.

I'm not a drupal master, but I did some investigating and it seems that when the node is loaded, it sets $node->revision based on whether the "create new revision" flag is set for the content type. Therefore, it cannot be set on a node by node basis.

This is different from "published", "promoted", etc because each of those options have a column in the node database table.

The "New revisions in moderation" flag also works because this module creates a database table to track which nodes have this set.

Would it make sense to add an additional field to the "revision_moderation" table to track the "create new revisions" flag? or is this a drupal core bug?

I hope I made sense and/or not missing something.

Comments

jbjaaz’s picture

Whoops, so I should of searched drupal first. Turns out, it has been brought up as being a potential bug; http://drupal.org/node/160487. In Drupal 6, the option has been moved into it's own fieldset with an explanation that it affects all nodes of that content type and can't be changed on a node by node basis.

So, should revision_moderation be tweaked to require the "create new revisions" option be set all the time? or does adding an additional column to the "revision_moderation" table make sense?

jbjaaz’s picture

So, I thought about this a little more and it makes sense to me to keep revision moderation consistent with Drupals' "by design" thinking that "create new revisions" can't be set on a node by node basis.

I attached a patch which removes the code I mentioned at the beginning of this thread.

My only final concern is how to tell users that if they want to use revision moderation, the "create new revisions" flag must be set on the content type or things won't work as expected.

jbjaaz’s picture

Title: programmatically set "create new revision" flag » "create new revisions" flag

changing title

jbjaaz’s picture

If the patch to integrate workflow_ng gets committed, then I retract my patch above because workflow_ng makes use of the flag.

webchick’s picture

Status: Active » Needs review

Marking as a patch. I don't have time to review this atm, sorry.

Leeteq’s picture

Subscribing.

add1sun’s picture

Status: Needs review » Needs work

btw, the workflow-ng patch did go in quite a while ago.

add1sun’s picture

Status: Needs work » Closed (won't fix)