Steps to reproduce:

  1. Configure workbench access to use the menu setup & pick menu.
  2. Disable "Require a Workbench Access form element"
  3. Configure a content type to use workbench access & moderation
  4. Enable "Limit available menu items based on Workbench Access." form element
  5. Create node and configure menu options & save.

Expected result:

The node is assigned a menu item, and belongs to the section represented by that menu item

Actual result:

The node will NOT be assigned to a section but the menu settings persist.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hazah’s picture

This issue still persist. Any assistance would be appreciated.

quartsize’s picture

Title: Function workbench_moderation_store is incompatible with Workbench Access » Function workbench_moderation_store is incompatible with Workbench Access (menu module)
Status: Active » Needs work
FileSize
1.07 KB

I'm not really sure this is the right approach, but here's the patch I'm using.

quartsize’s picture

Issue summary: View changes

Changed description to steps to reproduce.

quartsize’s picture

I believe #2.0 is being inaccurately ascribed to me.

ezheidtmann’s picture

I'm also experiencing this issue. Haven't tested the patch yet.

hazah’s picture

Issue summary: View changes

After a long investigation I have found out the following: The culprit is the option to "Limit available menu items based on Workbench Access. ". If this is checked, then the section is not assigned. It looks like a catch-22 issue when this happens. Essentially, you are denied permission on a section that does not yet exist. As such this may actually rest with the Workbench Access to resolve the issue. If I'm correct this patch will not do anything either. If you have similar outcomes, please let me know, this could be a non-issue for this module, but another issue may need to be opened on the access side of things. Cheers.

DamienMcKenna’s picture

Version: 7.x-1.3 » 7.x-1.x-dev

This also needs to be rerolled against v7.x-1.x-dev.

star-szr’s picture

Status: Needs work » Needs review
FileSize
1.07 KB
729 bytes

Revised the patch to clarify the comment and converted the tab indentation to spaces.

This solved the incompatibility between Workbench Access and Workbench Moderation for us.

jbylsma’s picture

I was able to duplicate this issue with the following:

  • Workbench Access and Workbench Moderation enabled
  • Workbench Access
    • Active access scheme: Menu
    • Limit available menu items based on Workbench Access: enabled
    • Automated section assigned: enabled
    • Allow multiple section assignments: disabled
    • Require a Workbench Access form element: disabled

The core of this issue is that, during workbench_moderation_store(), the $live_revision node is loaded but not run through the node_prepare hooks, where menu_node_prepare() sets the node's menu property. Outside of Workbench Access, this isn't a big deal; any menu action was already done during the ordinary hook_node flow. However, when Workbench Access is using Menus and the standard node form element (not using the Workbench Access form element), it requires the menu property to assign the node to a section.

I've attached two patches. The first patch streamlines the previously posted patches. It only calls menu_node_prepare() on the $live_revision node, and then prepares the menu property for menu_node_save() (see this API comment, Drupal core issue 1 and 2).

The second patch runs node_object_prepare() on the $live_revision node, which includes the node_prepare hooks. This will load the menu property. Even though the node_prepare hooks are used for FAPI display preparation, which isn't going to happen in workbench_moderation_store(), running them may still be beneficial. The following core modules use node_prepare hooks:

  • book
  • comment
  • menu
  • translation

The patches have been created against the current development branch. Thanks!

jbylsma’s picture

When the WM tests kicked back in, these patches were out of date. Attached rerolls.

I'd currently recommend using the first patch that only addresses the menu. Using node_object_prepare() does seem nicer, but it could introduce potential complications that aren't necessary to solving the immediate issue of getting Workbench Access with menus and Workbench Moderation playing together.