- 🇦🇺Australia marc.groth
I am still encountering this issue even after enabling the 'pathauto' and 'action' modules first.
I cleared the cache and ran the following command: drush migrate-import d7_action --update
Which results in the following error:
[error] The "pathauto_node_update_action" plugin does not exist. Valid plugin IDs for Drupal\Core\Action\ActionManager are: comment_unpublish_by_keyword_action, file_delete_action, file_permanent_action, file_temporary_action, node_assign_owner_action, node_unpromote_action, node_promote_action, node_make_sticky_action, node_unpublish_by_keyword_action, node_make_unsticky_action, user_add_role_action, user_block_user_action, user_cancel_user_action, user_remove_role_action, user_unblock_user_action, pathauto_update_alias, entity:delete_action:comment, entity:delete_action:media, entity:delete_action:node, action_send_email_action, action_goto_action, action_message_action, entity:publish_action:block_content, entity:publish_action:comment, entity:publish_action:media, entity:publish_action:menu_link_content, entity:publish_action:node, entity:publish_action:path_alias, entity:publish_action:taxonomy_term, entity:publish_action:paragraph, entity:save_action:block_content, entity:save_action:comment, entity:save_action:file, entity:save_action:media, entity:save_action:menu_link_content, entity:save_action:node, entity:save_action:taxonomy_term, entity:save_action:user, entity:unpublish_action:block_content, entity:unpublish_action:comment, entity:unpublish_action:media, entity:unpublish_action:menu_link_content, entity:unpublish_action:node, entity:unpublish_action:path_alias, entity:unpublish_action:taxonomy_term, entity:unpublish_action:paragraph, pathauto_file_update_action (/var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:53)
I did note that the system.actions config file is named: system.action.pathauto_update_alias_node.yml with the ID of 'pathauto_update_alias_node'. This differs from what the migration is looking for ('pathauto_node_update_action')... Perhaps this is part of the issue?
- 🇦🇺Australia marc.groth
A workaround for this is to set the target explicitly in hook_migration_plugins_alter().
This requires a custom module; but in my case I already have one for other migration tasks so that isn't a big deal. This is my code in case it is useful for anyone else (you may need to adjust accordingly):
$pathauto_update_actions = [ 'pathauto_file_update_action', 'pathauto_node_update_action', 'pathauto_taxonomy_term_update_action', 'pathauto_user_update_action', ]; foreach ($pathauto_update_actions as $pathauto_update_action) { $migrations['d7_action']['process']['plugin'][0]['map'][$pathauto_update_action] = 'pathauto_update_alias'; }
- 🇨🇭Switzerland berdir Switzerland
that could be added as a patch here.
That said, I also think this is a core bug, core shouldn't blindly assume that action plugins still exist and it should migrate non-existing ones.
- 🇳🇿New Zealand quietone
berdir and I chatted about this is slack.
The d7_action migration is rather simple and will migrate what you give it. Perhaps as #8 alludes to this is a mapping problem. I see on a second read that it is failing on an update. So, #9 maybe on the right track as well.
To be sure, can someone provide a bare bones D7 db with the problem? If I have that I will also write a migration test, which in other cases has turned up other bugs. And then we can apply a fix.