If a user is viewing a draft of a node, Workbench Moderation will add the workbench_moderation_moderate_form to the Workbench block (via workbench_moderation_set_message).

If this block is added to a region and a user is using some sort of inline editing (Panels IPE, Quickedit, etc.), that form will need to be reloaded as it is pointing to an old vid (see workbench_moderation_moderate_form_validate). Currently, there is no way to reload this form, so after doing any sort of inline editing the page needs to be refreshed before changing the workbench state via the Workbench block.

This patch adds a new callback that loads the Workbench block via AJAX, as well as a utility Javascript function that other modules can implement to refresh the block. I will be submitting patches to Panels IPE and Quickedit shortly that will pend the addition of this functionality.

I added this to Workbench Moderation instead of Workbench proper as the block needs to load the most recent vid of the Draft, which is a Workbench Moderation-specific behavior.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

samuel.mortenson’s picture

samuel.mortenson’s picture

FileSize
2.7 KB

Re-rolled as the block_alter hook attached the JS whether or not the block had content.

samuel.mortenson’s picture

FileSize
2.88 KB

As I added in Quickedit support, I noticed that an action isn't set appropriately for the form once it's added in. Re-rolled.

saltednut’s picture

saltednut’s picture

samuel.mortenson’s picture

FileSize
2.99 KB

Fixed notice when creating new nodes.

Dane Powell’s picture

I think the access argument for the menu item in #6 should use a more restrictive permission than "access content".

samuel.mortenson’s picture

I figured "access content" was sufficient as the permission "view moderation messages" is used when setting/getting moderation messages in workbench_moderation_messages(). From what I can tell, there is no existing permission set that blocks access to the block itself, only the messages. So unless you posses both permissions, you shouldn't be able to see anything about the Node's moderation status.

samuel.mortenson’s picture

I could also add a new permission, if that would be preferable.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

We've been using the patch in #6 for 6+ months with no issues.

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Needs work

A minor nitpick, but the patch needs to be updated to follow the Drupal coding standards.

saltednut’s picture

@vilepickle Just an FYI, Acquia's sales demo team (authors of Lightning 7.x and many of the patches that were bumped today) are focused on Demo Framework for 8.x and will not be continuing work on Lightning 7.x except for security issues. There are no RC's for Lightning 7.x planned.

Anonymous’s picture

Oh, I did not know that. We actually don't use Lightning but Acquia gave our team insight on which patches to use to get a nice WM / Panels workflow with revisioning and this was included in the past on D7.

Anonymous’s picture

Try this, took a stab at the code styling as I can see it... if you spot anything in particular let me know.