Unpublished content revision workbench moderation states are not migrated

Created on 26 April 2018, almost 7 years ago
Updated 6 April 2023, almost 2 years ago

Problem/Motivation

After upgrading to Drupal core 8.4.8 / Lightning 8.x-2.29 I am able to run the following Drush commands without errors:

drush wbm2cm-save
drush wbm2cm-clear
drush wbm2cm-restore

The problem is unpublished content does not filter correctly on the Content page (/admin/content)โ€”only filtering for published content produces any results. It seems that the wbm2cm module is only migrating published content revision workbench moderation states. I can see this be querying on the node_field_data and node_field_revision tables and then comparing results to the equivalent content_moderation tables:

mysql> SELECT nid, vid, status FROM node_field_data WHERE nid = 140;
+-----+-----+--------+
| nid | vid | status |
+-----+-----+--------+
| 140 | 673 |      0 |
+-----+-----+--------+
1 row in set (0.00 sec)

mysql> SELECT nid, vid, status FROM node_field_revision WHERE nid = 140;
+-----+-----+--------+
| nid | vid | status |
+-----+-----+--------+
| 140 | 673 |      0 |
+-----+-----+--------+
1 row in set (0.00 sec)

mysql> SELECT * FROM content_moderation_state_field_data WHERE content_entity_id = 140;
Empty set (0.00 sec)

mysql> SELECT * FROM content_moderation_state_field_revision WHERE content_entity_id = 140;
Empty set (0.00 sec)

Proposed resolution

Migrate the workbench moderation unpublished content revision workbench moderation states too.

๐Ÿ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States daniel korte Brooklyn, NY

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024