This is an extension to a patch that was committed a few months ago: https://www.drupal.org/project/workbench/issues/1357788
When using the Workbench Information pane with the Panelizer and ESI modules, we ran into problems. The pane was never rendered because there was no context attached to the pane. ESI needs to know that the context is coming from Panelizer, and that both $nid and $vid are necessary to ensure the pane is displayed for the proper node revision.
There might be a better way to do this, but the easiest approach is to add an edit form to the workbench_display pane. This automatically causes the context to be added as a configuration setting to the pane.
Please review the attached patch, and I would appreciate any feedback on how this can be improved.
Can also review the corresponding ESI patch I created to support node revisions (https://www.drupal.org/project/esi/issues/3044541). Both are necessary to get it to work as expected.
| Comment | File | Size | Author |
|---|---|---|---|
| workbench-attach_context_to_workbench_display-1.patch | 1.25 KB | sgdev |
Comments
Comment #2
sgdev commentedComment #3
sgdev commentedComment #4
agentrickardSupporting non-core modules is a feature request, not a bug.
How would one go about testing this patch, step-by-step?
Comment #5
sgdev commentedFair enough. These are the steps necessary to test:
1) Implement Panelizer (https://www.drupal.org/project/panelizer) and ESI (https://www.drupal.org/project/esi) modules.
2) Add following patches to support Panelizer with ESI, and fix Panels + ESI bugs:
https://www.drupal.org/files/issues/fatal_error_during-2877357-2.patch
https://www.drupal.org/files/issues/esi-panel-url-display-args-1841588-7...
https://www.drupal.org/files/issues/load-panels-plugins-inc-2220089-5.patch
https://www.drupal.org/files/issues/undefined_function_page_manager_get_...
https://www.drupal.org/files/issues/2018-06-10/esi-support_panelizer_ent...
https://www.drupal.org/files/issues/2018-06-03/esi-ttl_setting_check-297...
https://www.drupal.org/files/issues/2018-05-31/esi-override_context_stat...
https://www.drupal.org/files/issues/2018-06-03/esi-initialize_contexts_a...
https://www.drupal.org/files/issues/2019-03-30/esi-node_revision_support... (this one needs to be applied manually due to overlap with one of the previous patches)
3) Create a content type with Workbench and Panelizer enabled for it.
4) Add the "Workbench content status" pane to the content type's Panelizer layout.
5) Configure the "Workbench content status" pane to be cached using ESI, and choose to "Override cache context", and set "Cache per pane-context" and "Cache per page". Set user context to be "Pane changes accord to the current user's roles".
-----------------
At this point without the Workbench patch, the pane will not be displayed because there is no context. To test that it works properly with the patch, perform the following steps:
6) Remove the "Workbench content status" pane added to the Panelizer layout, and save the layout.
7) Apply the Workbench patch.
8) Re-add the "Workbench content status" pane to the layout. This time, the settings will show the ability to override the title. By clicking "Save", the context is attached to the pane.
9) Apply the ESI configuration settings again as described in #5.
10) Load a node for the content type, and the Workbench content status pane will be displayed.
Comment #6
sgdev commentedFYI, this is what's added to each feature containing the
workbench_displaypane after adding the patch included with this issue:Comment #7
agentrickardThanks!