Workbench moderation 7.x-1.x used to add a 'updating_live_revision' boolean to the node->workbench_moderation array in the workbench_moderation_store() function: $node->workbench_moderation['updating_live_revision'] = TRUE;. Many other modules use this information to determine if they have to act or not. Version 7.x-3.x no longer provides this value.

At least Workbench Path Revision seems to break because of this change (see #2852519: Support Workbench Moderation 3.x). I have found more references to the 'updating_live_revision' boolean in other modules such as Paragraphs (in paragraphs_field_update()), Link Checker (_linkchecker_isdefaultrevision()), Metatag (_metatag_isdefaultrevision()) and Field Collection (field_collection_field_update()).

Maybe $node->workbench_moderation['updating_live_revision'] was never meant as a public API, but it has certainly been used as such. I understand that major version releases sometimes break compatibility, but it is unfortunate that it was combined with a security update. This leaves site maintainers with the choice between a broken site, or an insecure one.

I kindly ask the Workbench Moderation maintainers to provide documentation regarding the removed 'updating_live_revision' boolean, so contrib module maintainers can update their code to support Workbench Moderation 3.x.

If an equivalent of 'updating_live_revision' exists, backwards compatibility could temporarily be provided by the Workbench Moderation module, adding the boolean again. That would give module maintainers time to update their code, and allow site maintainers to apply the security update without breaking their site.

Comments

marcvangend created an issue. See original summary.

mrgoodfellow’s picture

I'm finding this same issue and would love more information on why this was removed and a good workaround instead.

nairb’s picture

I've been using Workbench Moderation 7.x-3.0 for a while, along with Link Checker, Metatag, and Field Collection. With my usage, I have only had problems with the Link Checker module. I has been a while so it's hard to remember offhand what was happening, but I did patch _linkchecker_isdefaultrevision() in linkchecker.module and left some comments that may help you:

function _linkchecker_isdefaultrevision($entity) {

  // Workbench Moderation module
  
  // In order for Workbench Moderation to save a forward revision (i.e. a draft revision newer than the published revision), it must trigger node_save() twice—first to save the new revision and then again to set the node table entry back to the previously published revision. The second save requires that $entity->revision be set to 0, so yet another revision isn't created.
  // https://www.drupal.org/node/1811468#comment-9110519
  // https://www.drupal.org/node/2244789
  // https://www.drupal.org/node/1807460#comment-7999497
  if(module_exists('workbench_moderation') && workbench_moderation_node_type_moderated($entity->type) === TRUE ) {
    // Workbench Moderation 1.x uses the 'updating_live_revision' value to distinguish between the two node saves. This was depreciated in 3.x and we must check for 'published' instead.
    if (isset($entity->workbench_moderation['published']) || !empty($entity->workbench_moderation['updating_live_revision'])) {
      return TRUE;
    } else {
      return FALSE;
    }
  }

  return TRUE;
}
spadxiii’s picture

It looks like that the code in the above comment doesn't work either. Metatag module has pretty similar code which seems to work: https://cgit.drupalcode.org/metatag/tree/metatag.module#n2731

I have added a patch here: https://www.drupal.org/project/linkchecker/issues/3015001#comment-12863130

kunalkursija’s picture

I am also facing the same issue. Apart from the modules mentioned by @marcvangend , scheduler_workbench module also uses workbench_moderation['updating_live_revision'] in 2 of its functions.

agentrickard’s picture

Major version releases (like 1.x to 3.x) are allowed to have breaking changes. It is incumbent on the calling module to adapt.

The switch to Drafty (which was a security release) introduced this change years ago.

These issues should be re-filed under the appropriate modules.

agentrickard’s picture

Status: Active » Closed (works as designed)

Closing.