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.
If I override a node view using panels, the content moderation block is not shown. That makes it difficult to see the current status of the node you are editing. But why is it not rendering. It works on all nodes not overridden by panels.
I did not see that the view mode was page_manager when debugging the code, is that a custom view mode you made?
This issue seems to be a duplicate of this one, which I think has a better solution: https://www.drupal.org/node/1357788.
Comment | File | Size | Author |
---|---|---|---|
#11 | workbench_information-1462724-11.patch | 833 bytes | kiwimind |
#8 | workbench_moderation-panels-node-view-1462724-8.patch | 639 bytes | mortona2k |
#5 | panels-node-view-1462724-5.patch | 639 bytes | dsnopek |
Comments
Comment #1
lsolesen CreditAttribution: lsolesen commentedI am able to put in the workbench moderation block on the node view panel. The block is just not shown when I am logged in to my site, so I am moving this issue to panels. I have the proper permissions and on all nodes which I have not overridden by panels, the block is showing.
I have the following panel
Comment #2
lsolesen CreditAttribution: lsolesen commentedThis is probably a workbench moderation issue?
Comment #3
lsolesen CreditAttribution: lsolesen commentedSeems to be a duplicate of #1357788: 'Workbench information' doesn't show on panels 'Node template' page
Comment #4
Taxoman CreditAttribution: Taxoman commentedIs this also a problem in 2.x? (then it should be moved into that queue)
Comment #4.0
Taxoman CreditAttribution: Taxoman commentedMore precise desccription
Comment #5
dsnopekIt's really matter of the information in "Workbench information" never getting populated because workbench_moderation_node_view() only populates it on $view_mode == 'full', but when overriding the node view with Panels the $view_mode == 'page_manager'. Here is a patch to fix it!
Comment #6
mvcPatch in #5 works for me.
Comment #7
KarlSheaPatch in #5 also works for me.
I'm not sure why the view mode needs to be checked at all? This is the original code:
if (node_is_page($node) && $view_mode == 'full' && empty($node->in_preview))
The docs for node_is_page() say:
So what is checking the view mode trying to accomplish? Couldn't it just be left out altogether?
Comment #8
mortona2k CreditAttribution: mortona2k commentedMy node uses a custom view mode, but the workbench information block isn't showing up with this patch. For the line that it's changing, my node object has my custom view mode, not page_manager.
I'm not sure why the block visibility should be controlled in this code vs the block settings?
Comment #9
mortona2k CreditAttribution: mortona2k commentedI realized that my workbench info is showing the status of the last node rendered on the page, not the node that the page is for. Maybe the logic assumes there is only one node rendered with full view mode?
Comment #10
mortona2k CreditAttribution: mortona2k commentedComment #11
kiwimind CreditAttribution: kiwimind at Torchbox commentedWe've recently found the same issue. Unlike some of the other comments here though, ours was caused by an upgrade to contextual view modes while using a custom view mode instead of the default 'full' view mode.
I thought I'd update this thread rather than the one linked to in the initial comment as it seems to be more active and hopefully a wider audience than just panels users.
Rather than trying to tackle this to cover a single base, please find attached a patch that allows this to be overcome using variables, so that there are several ways of getting this to work:
1. Set the variable using drush
2. Set the variable in a custom module
3. Use settings to set the variable
I hope that this helps.
Thanks.
Comment #12
kiwimind CreditAttribution: kiwimind at Torchbox commentedComment #13
ron_s CreditAttribution: ron_s commentedI think both this patch (#11) and the one in #1357788 are of value. It really depends on what you need to accomplish.
The value of this patch is it allows for the block to be configured outside of Panels. We want staff to have the ability to move, add, and replace panel panes, but Workbench Information is one that we do not want them to remove or move.
By configuring it above the content area in the Blocks, and limiting access to the block configuration, it meets our needs.
The other patch in #1357788 is a more modular solution in that it creates a new panel pane rather than relying on a panels-enabled block. If you want to be able to configure and move the pane in page manager, this is the way to go.
I'm marking both of these as reviewed.