StubMigrationMessage no longer used in MigrateBatchExecutable

Created on 17 February 2025, about 2 months ago

Problem/Motivation

In farmOS, we noticed that our CSV importers stopped outputting migration messages to the UI. See this bug report: https://github.com/farmOS/farmOS/issues/924

I traced this issue to the change that was made in Allow developers to expose more configuration in the migrate form Fixed , which removed migrate_source_ui's MigrateBatchExecutable.

More background:

farmOS's CSV importer forms extend from migrate_source_ui's MigrateSourceUiForm, and we have a custom event subscriber that we used to output migration messages via $event->logMessage(), which calls $event->message->display(): https://github.com/farmOS/farmOS/blob/d999b1b2e2bbf3a92bb945ae0b5ff50510...

Previously (before Allow developers to expose more configuration in the migrate form Fixed ), the migrate_source_ui's MigrateBatchExecutable was explicitly using its own StubMigrationMessage class, which uses the Drupal core messenger service to display messages in the UI.

See: https://git.drupalcode.org/project/migrate_source_ui/-/blob/8ca8bc7da8f5...

After the removal of migrate_source_ui/src/MigrateBatchExecutable.php, it is now using migrate_tools's MigrateBatchExecutable, which uses Drupal core's MigrateMessage class instead.

See: https://git.drupalcode.org/project/migrate_tools/-/blob/a608e4b77057bda2...

Steps to reproduce

To be honest, I'm not sure if this actually affects the default behavior of this module or not. I haven't tested whether or not the default migrate_source_ui forms were displaying messages in the first place. But the changes in Allow developers to expose more configuration in the migrate form Fixed that removed MigrateBatchExecutable clearly didn't take into account the fact that it was using StubMigrationMessage instead of MigrateMessage.

Proposed resolution

Decide if MigrateBatchExecutable needs to be restored. Based on this comment Allow developers to expose more configuration in the migrate form Fixed , it sounds like this might not be the only thing that was broken by its removal.

Remaining tasks

TBD

User interface changes

Migration messages are no longer

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

🇺🇸United States m.stenta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @m.stenta
  • 🇺🇸United States m.stenta

    Decide if MigrateBatchExecutable needs to be restored.

    It may be that the benefits of removing MigrateBatchExecutable (less to maintain and keep in sync with migrate_tools) are enough to justify not restoring it, and the issues caused by its removal can be fixed in other ways.

    We will probably work around this issue in farmOS in the short term, but adding our own explicit call to \Drupal::messenger()->addMessage(). The only concern I have is that migrate_source_ui will restore MigrateBatchExecutable in a subsequent release and then we'll have *double* messages. It would be good to coordinate to avoid that.

Production build 0.71.5 2024