Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using the command drupal commerce:create:store
gives this error:
Error: Call to undefined method Drupal\commerce_store\Command\CreateStoreCommand::isMaintenance() in /var/www/html/shopperce_profile/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.
Error: Call to undefined method Drupal\commerce_store\Command\CreateStoreCommand::isMaintenance() in Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->switchMaintenanceMode() (line 80 of /var/www/html/shopperce_profile/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php).
Comment | File | Size | Author |
---|---|---|---|
#7 | the_commerce_create_store_command_is_broken_for_drupal_console_v1_9_0_3065103_7.patch | 1.2 KB | Yasser Samman |
|
Comments
Comment #2
Yasser SammanUsing Drupal\Console\Core\Command\Command instead of Symfony\Component\Console\Command\Command Solves the issue.
Comment #3
Anas_maw CreditAttribution: Anas_maw as a volunteer commentedComment #4
Anas_maw CreditAttribution: Anas_maw as a volunteer commentedThe last patch is needed after this pull request has been merged.
Comment #5
Yasser SammanFixed patch paths.
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedUpdating title.
Note that at some point we were told to extend the Symfony Console base class and to use the Drupal Console trait, now it seems that we should be extending the Drupal Console base class again? If so, we need to remove the trait usage.
It's not cool that Console is introducing breaking changes in minor releases.
Comment #7
Yasser SammanYou are right @bojanz, the trait usage is unnecessary when using the Drupal console base class. I've attached the correct patch.
Personally I think using the Drupal console base class is a better solution as it already uses the Symfony Console class.
Also, and excuse my ignorance regarding the matter, why not drush ?
Comment #8
bojanz CreditAttribution: bojanz at Centarro commentedDrush got rewritten to use Symfony Console from version 9. Back when we started using Console (in 2016, I think), Drush still had a D7-like API, with a much worse developer experience.
I'd be fine with offering both Drush and Console commands.
Comment #10
bojanz CreditAttribution: bojanz at Centarro commentedTweaked the ordering of the use statements and committed, thanks!