Drupal console changed the way commands work in the mean time.

This task is about using drupal console to create scaffolding for the existing commands and re-implement the logic.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bircher created an issue. See original summary.

  • bircher committed c1349b5 on 8.x-1.x
    Issue #2830660: disable drupal console comands for now, pending port
    
bircher’s picture

First WIP patch to get the commands working again.
Especially the translated messages are not working yet and we need to use the injected services.

Contributions welcome...

PS: For people preferring github: https://github.com/nuvoleweb/config_split/tree/2830660-console-command
But remember to comment here at least.

kmajzlik’s picture

I am getting
PHP Fatal error: Trait 'Drupal\Console\Command\Shared\ContainerAwareCommandTrait' not found in /var/www/modules/contrib/config_split/src/Command/ExportCommand.php on line 19
with console RC14

kmajzlik’s picture

Ok, this exactly can be fixed by:

- use Drupal\Console\Command\Shared\ContainerAwareCommandTrait;
+ use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait;

But it starts producing
TypeError: Argument 3 passed to Drupal\Console\Command\Config\DeleteCommand::__construct() must be an instance of Drupal\Core\Config\FileStorage, instance of Drupal\config_split\Config\StorageWrapper given in /var/www/vendor/drupal/console/src/Command/Config/DeleteCommand.php on line 48
then i just tried

vendor/drupal/console/src/Command/Config/DeleteCommand.php line 
-        FileStorage $configStorageSync
+       StorageInterface $configStorageSync

Sorry, I am OOP newbie and do not know if this is issue to Console or can be fixed in config_split code. I think it is in console - why use exactly FileStorage instead of any storage type.

And we also need to change:

-use Drupal\Console\Style\DrupalStyle;
+use Drupal\Console\Core\Style\DrupalStyle;
kmajzlik’s picture

The problem about using fileStorage in Console is fixed in dev (and will be in RC15), thanks to @jmolivas.
I will re-roll above patch on monday (currently it works for me).

kmajzlik’s picture

Console RC15 released yesterday. With patch atteched now i have Console RC15 working. I can see there both commands for config_split. At this moment i do not know exactly if they work properly(not tested yet). Just tested that Console is not failing.

kmajzlik’s picture

Composer:

  - Installing drupal/config_split (1.0.0-beta1) Loading from cache
  - Applying patches for drupal/config_split
    https://www.drupal.org/files/issues/config_split-fix_console-2830660-7.patch (Fix Console to be working)

Console:

$ drupal list config_split
Available commands for the "config_split" namespace:
  config_split:export        commands.config_split.export.description
  config_split:import        commands.config_split.import.description
kmajzlik’s picture

Status: Needs work » Needs review
kmajzlik’s picture

kmajzlik’s picture

After a week of working both with Drush and Console i do not see any difference with Console RC15 and patch from #7

@bircher - can be commited please?

  • bircher committed 23cecb0 on 8.x-1.x
    Issue #2830660 by karlos007: Port drupal console commands to work with...
bircher’s picture

Status: Needs review » Fixed

Thanks karlos007

I was on vacations and didn't have time to review your patch before, I committed it now. Thanks for your contribution!

Status: Fixed » Closed (fixed)

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