Essentially what is happening if a published node gets deleted before the shutdown function workbench_moderation_store is processed, then an exception gets thrown and kills the entire process.

I encountered this when following along here http://www.webomelette.com/content-fixtures-behat-testing-drupal-7. What is happening for me is fixture data is getting loaded and rolled back many times during the process. Some of my tests result in nodes being left in the published state before being rolled back, so these nodes cause the exception to be thrown in the shutdown function after calling workbench_moderation_node_live_load and trying to operate on the boolean false variable (since the original node was deleted but the cloned node persisted).

As far as I can tell, the workbench records are kept clean after the node was deleted, so, simply checking if an actual node was loaded and returned here should be sufficient.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lpeabody created an issue. See original summary.

lpeabody’s picture

Assigned: lpeabody » Unassigned
Status: Active » Needs review
FileSize
831 bytes

Patch with fix and comments attached.

nicrodgers’s picture

Status: Needs review » Needs work

I ran in to this issue as well. It was fixed with https://www.drupal.org/commitlog/commit/18554/614b29915cf1eafad4372eafec... from the issue here https://www.drupal.org/node/1919706 but then subsequently broken again by https://www.drupal.org/commitlog/commit/18554/928518e37a756a91d88e8bbaee... from https://www.drupal.org/node/1436260 - due to the re-roll.

The patch in #2 successfully applies to the latest 7.x-1.x-dev and fixes the issue for me, thanks!

Just a tiny little nitpick:

+++ b/workbench_moderation.module
@@ -1763,6 +1763,13 @@ function workbench_moderation_store($node) {
+      // function, we no longer need to be concerned with it, so just log
+      // a watchdog status to surface the deletion and return.

Needs re-wrapping to maximise what's included within the 80-char limit.

lpeabody’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
831 bytes

Re-rolled to maximize words within 80-character limit.

@nicrodgers glad the patch worked out for you. I'll take a look at the other issues you brought up as well.

nicrodgers’s picture

Great stuff, top man!