Hey everyone,
I've been excitedly testing Workbench Moderation, but I've run into one problem for sites that also use the popular Panels module to override a node's display.
Panels has a default "node template" panel that allows you to easily replace the standard display of a node with a panel instead (with variants based on the content type being viewed). This works great on Workbench Moderation's "View Published" tab, but when I click on "View Draft", the draft is not displayed using the Panel (instead it is using the default Drupal node display). Since our panel looks nothing like the default node display, "drafts" don't resemble the actual published node at all.
Any ideas on how to solve this? I tried creating an additional Panel that would override the "node/%node/draft" path, but it won't allow me to do so because it says that path is already in use.
Is deeper Panels integration needed?
Thanks,
Ben
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | task_plugin-1188590-13.patch | 12.97 KB | anon |
| #9 | task_plugin-1188590-9.patch | 6.53 KB | stevector |
Comments
Comment #1
Shadlington commentedI've hit this problem too.
Subbing.
Comment #2
Shadlington commentedThis issue may be relevant, in that it pertains to adding page manager defaults for workbench: #1103638: Task plugin for 'admin/workbench'
Its not inclusive of workbench moderation but I would guess that similar work would be required.
Comment #3
dddbbb commentedI too am having his problem.
Comment #4
stevectorYes, what we'd need is a task plugin to allow Page Manager to act on the path "node/%node/draft." Patches welcome.
It would look a lot like the patch I wrote in #1103638: Task plugin for 'admin/workbench'
Comment #5
SandraL commentedI've run up against this problem as well.
This isn't the most robust of solutions, but to get it working in my environment for now I changed the workbench_moderation_node_view_draft function in workbench_moderation.node.inc from
to
At least, it seems to be working so far - my panel page drafts are showing up in panels and my non-panel page drafts aren't breaking.
Comment #6
stevectorThat's an interesting approach and I imagine it helps to get around the the need to recreate a Panels layout at node/%node/%draft. I wonder if we could get that benefit in the task handler approach so as to avoid module_exists().
Comment #7
robeano commentedI don't consider this a 1.0 blocker but it seems like we should figure this out so wb and panels play well together. I'm going to mark this Critical and see what happens.
Comment #8
anonThe code in #5 works with some small edits, BUT if you you will get the wrong context, so if you using any context in your panel, they will be the current published node.
We have to create a diffrent context that will load a node with a specific vid.
Comment #9
stevectorI wrote a task plugin it works. I asked in IRC the best way to cleanly reuse the task handler (Panels) definition from node/%node inside of this task plugin. Merlinofchaos gave me a much simpler and better answer. He said that workbench_moderation_node_view_draft() should directly reuse whatever page callback is used at node/%node.
So the task plugin isn't necessary for the use case discussed in this thread. I've included it in the patch because I had already written it and there is a different use case for it. One could use it if there was a need for different Panels layouts at node/%node vs node/%node/draft.
In reviewing this patch please look at the way I use menu_get_item(). Should we be responding to more than include_file and page_callback?
Also to write the task plugin I did a lot of copy/past find/replace. Are there any strings that need to be updated yet?
Comment #10
dave reidComment #11
anonTake a look at http://drupal.org/project/workbench_panels
Comment #12
dave reid@anon: Rather than creating a separate module that will eventually be deprecated, it would be really great if you could help review this issue here.
Comment #13
anonThe patch in #9 works fine, and I have used that patch and added support for node revisions aswell.
I will ask someone to remove workbench_panels when this issue is fixed.
Comment #14
anonComment #15
becw commentedI can take a look at this patch.
Comment #16
elly commentedInterested in solutions here, thank you to people working on this problem which I also just ran into. Subbing.
Comment #17
Juan C commentedsubscribe
Comment #18
elly commentedI can't get any of these solutions to work. The patch in #13 applies cleanly but I don't see new override options in page manager. I looked at workbench_panels, and did see the override options after installed it, but after creating overrides for node draft and node revision forms, I still didn't see those layouts presented when I went to the draft/revision creation pages in question. Am I missing something?
Comment #19
dixon_subscribe
Comment #20
stevectorThis patch works for me. Elly you may need to clear your caches to see the options at admin/structure/pages
Comment #21
stevectorhttp://drupalcode.org/project/workbench_moderation.git/commit/8843ba019c...
Comment #22
stevectorUsed the wrong status in the last comment.
Comment #28
delacosta456 commentedhi
Please i would like to know if it has been added to workbench_moderation module?
thanks
Comment #29
joelpittetyes in dev as mentioned in comment #21 @delacosta456. It will likely make it into the next release if no security stuff jumps ahead