Drupal Console broke all commands recently, so our command needs to be rewritten.

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new6.42 KB

Here's an initial version.

Not committing it cause of reports of breakage from the Metatag module: #2810835: Installation problem PHP Fatal error: Trait 'Drupal\Console\Command\Shared\CommandTrait'.
I've also seen two bugs: the country and currency are allowed to be empty (just takes the first value from the list), and the default value for the currency is not displayed.

bojanz’s picture

Status: Needs review » Needs work

Drupal Console changed their API again after this patch was written.

gauravjeet’s picture

Status: Needs work » Needs review
StatusFileSize
new6.81 KB
new6.81 KB

Drupal Console command rewrite. Checked after regeneration, looks like it works fine.

https://github.com/drupalcommerce/commerce/pull/744

bojanz’s picture

Status: Needs review » Needs work

You shouldn't add the command to commerce_store.services.yml, that can cause crashes for users who don't use Console.
Instead, you need a console.services.yml file, look at drupal.org/project/ludwig for an example.

Also look at Ludwig's DownloadCommand for an example of how you can inject services instead of using $this->get().

mglaman’s picture

Status: Needs work » Needs review
StatusFileSize
new9.1 KB
[03:04 PM]-[mglaman@Matts-iMac]-[~/Drupal/sites/commerce2x/web] 
$ ../bin/drupal commerce:create:store
Enter the store name: Console
Enter the store email: console@glamanate.com
Enter the store country: United States
Enter the store currency [USD]: 
The store has been created. Go to http://default/store/2/edit to complete the store address and manage other settings.

Fixing code stylings for PR.

mglaman’s picture

  • bojanz committed 5f90449 on 8.x-2.x authored by mglaman
    Issue #2812939 by gauravjeet, bojanz, mglaman: Rewrite the commerce:c...
bojanz’s picture

Status: Needs review » Fixed

Thanks, everyone.

emanuelrighetto’s picture

Status: Fixed » Needs review

In order to do not brake drupalconsole if you have the devel and webprofile modules activated you have to reference the EntityManager to its interface.
I made a pull request to solve this: https://github.com/drupalcommerce/commerce/pull/806

bojanz’s picture

Status: Needs review » Fixed

@emanuelrighetto
Please don't reopen fixed issues after a release, a bug deserves its own issue.
Continuing in #2913444: Conflict with webprofiler.

Status: Fixed » Closed (fixed)

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