- 🇮🇳India bhanu951
Here is a slightly modified query when you are only migration only latest revision of the node.
Below query only retrieves currently active moderation state for migration.
$query = $source->getDatabase() ->select('workbench_moderation_node_history', 'wm') ->fields('wm', ['state']) ->condition('wm.nid', $row->getSourceProperty('nid')) ->condition('wm.is_current', '1'); $value = $query->execute()->fetchField(); if ($value) { $row->setSourceProperty('moderation_state', $value); }