The following problem occurs in our local implmentation of Drupal 7.34 using both older and latest versions of Workbench + Workbench Moderation.

Workbench Moderarion does not allow anyone (regardless of Workbench Moderation
permissions, state/transition configuration, or content ownership) to edit (not create but
EDIT) the latest saved revisions to a draft revision of an already published content item.

When a new draft is created/saved from an already published content item, and you
choose to "Edit draft," the CMS editor does not reflect the current draft
content. Instead it shows the published content in the editor form fields with the following Workbench Moderation warning at the top of the form - "Status: New draft of live content."

Meanwhile the "View draft" option works perfectly fine, showing the draft revision content. But the "Edit draft" option behaves like a "Create new draft" option (as described above).

The source of the warning message (i.e., "Status: New draft of live content.") is in workbench_moderation.module.

For some reason when the $node->workbench_moderation object/property is initiated upon editing of a pending draft revision of an already published node, the state is set as “published” - as output of conditional test of $state['my_revision']->published from lines 1986-1998 of workbench_moderation.module 7.x-1.4:

// For new content, this property will not be set.
if (isset($node->workbench_moderation)) {
  $state = $node->workbench_moderation;
  if (!empty($state['published'])) {
    $node_published = TRUE;
  }
  if ($state['my_revision']->published) {
    $revision_published = TRUE;
  }
  if ($state['my_revision']->vid == $state['current']->vid) {
    $revision_current = TRUE;
  }
}

We've verified that this behavior is not how Workbench Moderation behaves in other Drupal implmenetations. Normally, clicking the "Edit draft" button for a pending draft revision of an already published node opens up the editor where the latest draft revision edits are reflected in the preset values of the form fields. There must be something in our configuration causing the problem, but I wanted to see if anyone else has come across this problem and/or already solved it.

Thank you in advance for your consideration and help!

Comments

huskey786’s picture

Yes we have the exact same issue, cannot have a 'new draft of published' go back through the workflow statuses.

The only current fix is to edit published content and set it to published right away, without being able to verify the edits. At least i am not the only one who has come across this issue.

dgtlmoon’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Priority: Normal » Major

I can confirm this on a 'standard' profile install and current 1.x

dgtlmoon’s picture

adamps’s picture

Priority: Major » Normal
Status: Closed (duplicate) » Active

@dgtlmoon It looks like the symptoms here are the opposite of the issue you marked as duplicate.

As the OP stated, this issue seems to only occur in specific situations - not on his other sites, not for me, not for the people commenting on the issue you reference. OP raised a support request asking for help to work out why - so I've set this back to normal not major.

@web.dev.cas Note that the lines you reference $revision_published is set based on $state['my_revision']->published rather $state['published'], so this isn't necessarily doing anything wrong.

web.dev.cas’s picture

Turns out this was a conflict between Workbench moderate overriding the node/%node/edit menu item and ctools page manager with node/%node/edit page enabled. Since our node/%node/edit page manager didn't have any variants, we were able to disable it (/admin/structure/pages) thereby allowing Workbench moderation to load the latest draft on the edit page.

web.dev.cas’s picture

Status: Active » Closed (fixed)
mingsong’s picture

There is a solution for this issue with Entity API module.

See the post:
https://www.drupal.org/node/2057751#comment-11504577

ianwensink’s picture

Thread #7 fixes the issue with displaying current revision, instead of draft in combination with Panels. Patch doesn't fix the Edit draft for me.

Attached patch should fix the issue of /node/[nid]/edit showing the current revision page by changing the workbench-moderation Edit link.

Changed:

$revision_operations['edit'] = l($edit_operation_title, "node/{$revision->nid}/edit", array('query' => array('destination' => "node/{$revision->nid}/moderation")));

To:

$revision_operations['edit'] = l($edit_operation_title, "/node/{$revision->nid}/revisions/{$revision->vid}/edit", array('query' => array('destination' => "node/{$revision->nid}/moderation")));

Don't know if others had this issue, but this fixed it for me.

joelpittet’s picture

@ianwensink, you shouldn't put the / infront of node because if a base_url is in a subfolder those will break.

labboy0276’s picture

Version: 7.x-1.x-dev » 7.x-3.x-dev
StatusFileSize
new847 bytes

I rerolled this patch for the 3.x version and fixed the mistake above.

bsnodgrass’s picture

We had a site with the same issue applying this patch did not solve the problem.

A patch on a related issue did:
WM was not loading drafts in Edit Draft mode when Panels has custom node/%node paths working.

https://www.drupal.org/node/1285090
https://www.drupal.org/files/issues/workbench_moderation-playnicewithpan...