Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Steps to reproduce:
- Configure workbench access to use the menu setup & pick menu.
- Disable "Require a Workbench Access form element"
- Configure a content type to use workbench access & moderation
- Enable "Limit available menu items based on Workbench Access." form element
- 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.
Comment | File | Size | Author |
---|---|---|---|
#11 | workbench_moderation-workbench_access_menu_compatibility-1975996-9--2.patch | 986 bytes | jbylsma |
#11 | workbench_moderation-workbench_access_menu_compatibility-1975996-9--1.patch | 829 bytes | jbylsma |
#2 | wb_access_menu-1975996-2.patch | 1.07 KB | quartsize |
#7 | workbench_moderation-1975996-7.patch | 1.07 KB | star-szr |
#7 | interdiff.txt | 729 bytes | star-szr |
Comments
Comment #1
hazah CreditAttribution: hazah commentedThis issue still persist. Any assistance would be appreciated.
Comment #2
quartsize CreditAttribution: quartsize commentedI'm not really sure this is the right approach, but here's the patch I'm using.
Comment #2.0
quartsize CreditAttribution: quartsize commentedChanged description to steps to reproduce.
Comment #3
quartsize CreditAttribution: quartsize commentedI believe #2.0 is being inaccurately ascribed to me.
Comment #4
ezheidtmann CreditAttribution: ezheidtmann commentedI'm also experiencing this issue. Haven't tested the patch yet.
Comment #5
hazah CreditAttribution: hazah commentedAfter 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.
Comment #6
DamienMcKennaThis also needs to be rerolled against v7.x-1.x-dev.
Comment #7
star-szrRevised 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.
Comment #8
jbylsma CreditAttribution: jbylsma commentedI was able to duplicate this issue with the following:
The core of this issue is that, during
workbench_moderation_store()
, the$live_revision
node is loaded but not run through thenode_prepare
hooks, wheremenu_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 ordinaryhook_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 formenu_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 thenode_prepare
hooks. This will load the menu property. Even though thenode_prepare
hooks are used for FAPI display preparation, which isn't going to happen inworkbench_moderation_store()
, running them may still be beneficial. The following core modules usenode_prepare
hooks:The patches have been created against the current development branch. Thanks!
Comment #11
jbylsma CreditAttribution: jbylsma commentedWhen 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.