You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Many contrib modules extend SanitizePluginInterface in their Drush commands. The move of Drush\Drupal\Commands\sql\SanitizePluginInterface to Drush\Commands\sql\sanitize\SanitizePluginInterface will force many modules to create a version of the command for Drush 12 and before and another for Drush 13.
This would normally be easy to solve with the use of drush.services.yml, but from what I understand, this is also being removed in Drush 13. In theory, one could maybe create a new command for Drush <=12, and use drush.services.yml for that, but how does one prevent that Drush 13 also loads that command?
I believe the best option is to restore the Drush\Drupal\Commands\sql\SanitizePluginInterface file, just making it an empty shell for the new interface, and this could be eventually be removed when Drupal 10 reaches end-of-life, and support for Drush 11 and 12 can be dropped from modules. The interface should be marked for deprecation until Drupal 12 (and I guess Drush 15 is out).
To Reproduce
Tried to run a module that extends SanitizePluginInterface in Drupal 11.
Expected behavior
Module would run.
Actual behavior
Got the following: [error] Error: Interface "Drush\Drupal\Commands\sql\SanitizePluginInterface" not found in include() (line 18 of /data/app/modules/contrib/webform/src/Commands/WebformSanitizeSubmissionsCommands.php) #0 /data/vendor/composer/ClassLoader.php(576): include()
Workaround
Is there a way to do conditional use statements in PHP?
Describe the bug
Many contrib modules extend SanitizePluginInterface in their Drush commands. The move of Drush\Drupal\Commands\sql\SanitizePluginInterface to Drush\Commands\sql\sanitize\SanitizePluginInterface will force many modules to create a version of the command for Drush 12 and before and another for Drush 13.
This would normally be easy to solve with the use of drush.services.yml, but from what I understand, this is also being removed in Drush 13. In theory, one could maybe create a new command for Drush <=12, and use drush.services.yml for that, but how does one prevent that Drush 13 also loads that command?
I believe the best option is to restore the Drush\Drupal\Commands\sql\SanitizePluginInterface file, just making it an empty shell for the new interface, and this could be eventually be removed when Drupal 10 reaches end-of-life, and support for Drush 11 and 12 can be dropped from modules. The interface should be marked for deprecation until Drupal 12 (and I guess Drush 15 is out).
To Reproduce
Tried to run a module that extends SanitizePluginInterface in Drupal 11.
Expected behavior
Module would run.
Actual behavior
Got the following: [error] Error: Interface "Drush\Drupal\Commands\sql\SanitizePluginInterface" not found in include() (line 18 of /data/app/modules/contrib/webform/src/Commands/WebformSanitizeSubmissionsCommands.php) #0 /data/vendor/composer/ClassLoader.php(576): include()
Workaround
Is there a way to do conditional use statements in PHP?
System Configuration
Additional information
See https://www.drupal.org/project/webform/issues/3445590 (and probably many, many others will soon follow)
The text was updated successfully, but these errors were encountered: