Migrate Tools v6.1.x compatibility

Created on 24 July 2025, about 1 month ago

Problem/Motivation

Per πŸ› New parameters introduced in MigrateExecutable class constructor Active a change introduced in πŸ“Œ Fix PHPCS issues Active had the unfortunate impact of changing \Drupal\migrate_tools\MigrateBatchExecutable::__construct function signature in a minor release.

Steps to reproduce

If using Migrate Source UI 8.x-1.2 with Migrate Tools 6.1.x, submitting the form at admin/content/migrate_source_ui shows:

TypeError: Drupal\migrate_tools\MigrateBatchExecutable::__construct(): Argument #3 ($keyValue) must be of type Drupal\Core\KeyValueStore\KeyValueFactoryInterface, array given, called in /app/web/modules/contrib/migrate_source_ui/src/Form/MigrateSourceUiForm.php on line 182 in Drupal\migrate_tools\MigrateBatchExecutable->__construct() (line 72 of modules/contrib/migrate_tools/src/MigrateBatchExecutable.php).

Proposed resolution

- Update Migrate Source UI to accommodate the changes in πŸ“Œ Fix PHPCS issues Active
- As much as required, make the fixed Migrate Source UI depend on matching Migrate Tools version

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

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

Comments & Activities

  • Issue created by @xurizaemon
  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    We should be careful here to ensure that we don't make the same mistake made in Migrate Tools. If the method signature is changed in such a way that it breaks downstream code using/extending it, then Migrate Source UI MUST increment its major version and properly document this.

    That is, unless Migrate Source UI isn't committed to semantic versioning... :-(

    Perhaps this would be a good time to switch from 8.x-1.x to a 2.0.x with true semantic versioning.

    Let's see what gets committed in πŸ› New parameters introduced in MigrateExecutable class constructor Active first ...

  • πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

    Good point Michael. I feel I'm confused now from juggling changes (and git is giving me weird results / not showing changes from upstream?), so I'm going to leave this for tonight. Thanks!

  • heddn Nicaragua

    The fixes for this were already in the dev branch. I thought I'd released it in a tag, but must have missed it.

    https://www.drupal.org/project/migrate_source_ui/releases/8.x-1.3 β†’

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

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    We should be careful here to ensure that we don't make the same mistake made in Migrate Tools. If the method signature is changed in such a way that it breaks downstream code using/extending it, then Migrate Source UI MUST increment its major version and properly document this.

    That is, unless Migrate Source UI isn't committed to semantic versioning... :-(

    This change broke farmOS CSV importers... again. Exactly as I predicted it would. :-(

    @heddn can we please consider adopting true semantic versioning across all these `migrate_*` projects and commit to not introducing breaking changes outside of major version updates?

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    Specifically, farmOS has its own form class that extends the one from this module (class CsvImportForm extends MigrateSourceUiForm) in order to inject additional dependencies, so by changing the __construct() signature of this module's class, it breaks any downstream module classes that extend it.

    https://github.com/farmOS/farmOS/blob/3.x/modules/core/import/modules/cs...

    These are the PHPStan failures that alerted us to the issue (our automated tests for CSV importers also failed):

     ------ ---------------------------------------------------------------------- 
      Line   modules/core/import/modules/csv/src/Form/CsvImportForm.php            
     ------ ---------------------------------------------------------------------- 
      70     Method                                                                
             Drupal\migrate_source_ui\Form\MigrateSourceUiForm::__construct()      
             invoked with 3 parameters, 6 required.                                
      80     Return type mixed of method                                           
             Drupal\farm_import_csv\Form\CsvImportForm::create() is not covariant  
             with return type                                                      
             static(Drupal\migrate_source_ui\Form\MigrateSourceUiForm) of method   
             Drupal\migrate_source_ui\Form\MigrateSourceUiForm::create().          
      95     Return type mixed of method                                           
             Drupal\farm_import_csv\Form\CsvImportForm::getFormId() is not         
             covariant with return type string of method                           
             Drupal\migrate_source_ui\Form\MigrateSourceUiForm::getFormId().       
      102    Return type mixed of method                                           
             Drupal\farm_import_csv\Form\CsvImportForm::buildForm() is not         
             covariant with return type array of method                            
             Drupal\migrate_source_ui\Form\MigrateSourceUiForm::buildForm().       
      123    Return type mixed of method                                           
             Drupal\farm_import_csv\Form\CsvImportForm::validateForm() is not      
             covariant with return type void of method                             
             Drupal\migrate_source_ui\Form\MigrateSourceUiForm::validateForm().    
     ------ ----------------------------------------------------------------------
    
Production build 0.71.5 2024