After posting a draft node as a content author, I'm taken to a preview of the node as expected, but I get a duplicate moderation form. Any idea why? One thing to not is I'm also using workbench_media and the image on this page is a media field, but both forms point to the same thing and seem to have no indication that one would be for the media and the other for the node (and we're not moderating media independently of nodes anyway). See the attached screenshots.

Comments

seanr’s picture

Screenshot of form
Screenshot of DOM

Turns out it's an interaction with panelizer. One of the invocations of workbench_moderation_node_view() descends from node_build_content(), the other one from ctools_node_content_render_node().

seanr’s picture

Title: Moderation form appears twice » Panelizer causes moderation form to appear twice
seanr’s picture

Status: Active » Needs review
StatusFileSize
new3.25 KB

I can't find a way around the underlying issue (hook_node_load firing twice due to Panelizer), but the patch works around it by assigning array keys including the node ID and the type of message to the members of the $info_block_messages array. If anyone can come up with a better patch that resolves the root cause, I'm all ears, but this works for me right now. ;-)

damienmckenna’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Issue summary: View changes

Does it still apply against v7.x-1.x-dev?

Status: Needs review » Needs work

The last submitted patch, 3: workbench_moderation-panelizer-2029735-2.patch, failed testing.

Status: Needs work » Needs review
widukind’s picture

The patch worked for us with the 7.x-1.3 version of this module. However, it does not apply cleanly any more against 7.x-1.x.
Re-rolled the patch and attached it here, please verify.

joewhitsitt’s picture

Status: Needs review » Reviewed & tested by the community

#8 Worked for us using latest 7.x-1.x-dev. Applied clean. Tested moving through moderation states on both new and existing content with success.

The last submitted patch, 3: workbench_moderation-panelizer-2029735-2.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: workbench_moderation-panelizer-2029735-8.patch, failed testing.

widukind’s picture

Seems to have been addressed in Issue #2346551 since.

https://www.drupal.org/node/2346551

^ Nevermind, different branch.

Status: Needs work » Needs review