After release of Workbench Moderation 3.0, the workflow for saving revisions was heavily changed. Before it was like described in this module:

The steps taken by Workbench Moderation is to save the forward revision first and overwrite this with the live version in a shutdown function in a second step.

The way metatag module detected if it was a live revision was through function "_metatag_isdefaultrevision($entity)" which was checking if field $entity->workbench_moderation['updating_live_revision'] was defined.

Now in Workbench Moderation 3.0 we don't have the live revision concept and neither this "updating_live_revision" field anywhere.

If I understood correctly, every time we save a node two new revisions are created, one is a copy of the old version and the other is the new version. They should have the metatag processed.

My patch simply removes the logic to detect if it is a live revision.

The reason why I consider this issue as Minor, is because the behavior is the same before and after the patch ($entity->workbench_moderation['updating_live_revision'] is now always empty and so _metatag_isdefaultrevision($entity) returns always FALSE)...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dxvargas created an issue. See original summary.

dxvargas’s picture

Issue summary: View changes
DamienMcKenna’s picture

Status: Active » Needs review

Thanks for reporting this and taking the time to put a patch together. Lets see what the testbot says about the patch.

DamienMcKenna’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

At this point, lets add some tests to confirm it all works correctly.

DamienMcKenna’s picture

This adds WM as a test dependency.

DamienMcKenna’s picture

Status: Needs work » Needs review

  • DamienMcKenna committed f5d2ef5 on 7.x-1.x
    Issue #2831073 by DamienMcKenna: Added Workbench Moderation as a test...
DamienMcKenna’s picture

Priority: Minor » Normal
Status: Needs review » Needs work

Ok, that minor piece was committed, now back to needing work to add the tests.

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
4.16 KB

This adds a placeholder file to put the tests in.

dxvargas’s picture

I have added a test in the placeholder given in #9.

Status: Needs review » Needs work

The last submitted patch, 10: metatag-n2831073-10.patch, failed testing.

dxvargas’s picture

Status: Needs work » Needs review
FileSize
6.95 KB

Sorry, wrong path for files... submitting again!

DamienMcKenna’s picture

This adds a hook_requirements() error if an old version of WM is installed.

DamienMcKenna’s picture

Status: Needs review » Fixed
Parent issue: » #2831837: Plan for Metatag 7.x-1.19 release

Committed. Thanks!

  • DamienMcKenna committed f9735a1 on 7.x-1.x authored by dxvargas
    Issue #2831073 by DamienMcKenna, dxvargas: Remove old workarounds due to...
drumm’s picture

hass’s picture

Status: Fixed » Needs work

Thanks for breaking wb 1.x support. As you may know wb 3.x is so buggy that people should not use it. Never release a security release for metatag.

I hope we can simply downgrade metatag module without loosing data.

@todo: Add a requirement hook to metatag so the upgrade stops and does not complete before wb 3.x is installed.

DamienMcKenna’s picture

Status: Needs work » Fixed

Please see #2840500: Incompatibility with workbench_moderation 7.x-1.x where this was rolled back with some changes to make them optional based upon which version of Workbench Moderation is installed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.