The current generate commands aren't working:

$ drupal --version
Drupal Console version 1.0.0-rc11

$ drupal generate:metatag:tag --module='metatag_app_links' --group='app_links' --base_class='MetaPropertyBase' -y --multiple=FALSE --secure=FALSE

 [ERROR] Command "generate:metatag:tag", is not a valid command name.                                                   
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

jmolivas’s picture

@DamienMcKenna can you try updating to latest DrupalConsole RC-14?

DamienMcKenna’s picture

Ah, right.

$ drupal cache:rebuild all
 Rebuilding cache(s), wait a moment please.
 [OK] Done clearing cache(s).                                                                                           

$ drupal self-update
 [ERROR] Command "self-update", is not a valid command name.                                                            
jmolivas’s picture

Status: Active » Needs review

The `self-update` command only work for the Launcher aka global executable and it must be run outside of any drupal site.

In order to update per site installation you need to execute `composer update drupal/console --with-dependencies` within the drupal site.

DamienMcKenna’s picture

Ok, that did solve the problem, thanks.

We now have the problem that the string labels aren't loading - did the path for the translation files change?

I'm also renaming the commands to include the "plugin" keyword, e.g. generate:plugin:metatag:tag.

Status: Needs review » Needs work

The last submitted patch, 5: metatag-n2842092-7.patch, failed testing.

jmolivas’s picture

@DamienMcKenna looking at the translation issue, a patch will be coming soon.

DamienMcKenna’s picture

@jmolivas: Thanks!

DamienMcKenna’s picture

The test failures are because of a problem with the testbot, not the module's codebase - the tests work fine locally.

DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
3.12 KB

And so I uploaded the wrong patch in #5, reverted the changes locally, and have lost the changes I made. Doh.

This renames the commands.

DamienMcKenna’s picture

Status: Needs review » Needs work

I'm now getting the following error:

$ drupal generate:plugin:metatag:tag --module='metatag_app_links' --group='app_links' --base_class='MetaPropertyBase' -y --multiple=FALSE --secure=FALSE

Fatal error: Call to undefined method Symfony\Component\Console\Formatter\OutputFormatter::escapeTrailingBackslash() in /Users/yourname/Sites/drupal/8/vendor/symfony/console/Helper/SymfonyQuestionHelper.php on line 57

jmolivas’s picture

@DamienMcKenna Did you updated to 8.2.5 ?

This is a conflict between dependencies

A new DrupalConsole release is scheduled for early Monday.

DamienMcKenna’s picture

I ran composer update --with-dependencies..

DamienMcKenna’s picture

PS.

$ composer show -i
You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
alchemy/zippy                         0.4.3              Zippy, the archive manager companion
asm89/stack-cors                      1.0.0              Cross-origin resource sharing library and stack middleware
behat/mink                            dev-master bb28774 Browser controller/emulator abstraction for PHP
behat/mink-browserkit-driver          v1.3.2             Symfony2 BrowserKit driver for Mink framework
behat/mink-goutte-driver              v1.2.1             Goutte driver for Mink framework
composer/installers                   v1.2.0             A multi-framework Composer library installer
composer/semver                       1.4.2              Semver library that offers utilities, version constraint par...
dflydev/dot-access-configuration      dev-master ae6e713 Given a deep data structure representing a configuration, ac...
dflydev/dot-access-data               v1.1.0             Given a deep data structure, access data by dot notation.
dflydev/placeholder-resolver          v1.0.2             Given a data source representing key => value pairs, resolve...
dnoegel/php-xdg-base-dir              0.1                implementation of xdg base directory specification for php
doctrine/annotations                  v1.2.7             Docblock Annotations Parser
doctrine/cache                        v1.6.1             Caching library offering an object-oriented API for many cac...
doctrine/collections                  v1.3.0             Collections Abstraction library
doctrine/common                       v2.5.3             Common Library for Doctrine projects
doctrine/inflector                    v1.1.0             Common String Manipulations with regard to casing and singul...
doctrine/instantiator                 1.0.5              A small, lightweight utility to instantiate objects in PHP w...
doctrine/lexer                        v1.0.1             Base library for a lexer that can be used in Top-Down, Recur...
drupal/console                        1.0.0-rc14         The Drupal CLI. A tool to generate boilerplate code, interac...
drupal/console-core                   1.0.0-rc14         Drupal Console Core
drupal/console-en                     1.0.0-rc14         Drupal Console English Language
easyrdf/easyrdf                       0.9.1              EasyRdf is a PHP library designed to make it easy to consume...
egulias/email-validator               1.2.13             A library for validating emails
fabpot/goutte                         v3.2.1             A simple PHP Web Scraper
gabordemooij/redbean                  v4.3.3             RedBeanPHP ORM
guzzlehttp/guzzle                     6.2.2              Guzzle is a PHP HTTP client library
guzzlehttp/promises                   v1.3.1             Guzzle promises library
guzzlehttp/psr7                       1.3.1              PSR-7 message implementation
ircmaxell/password-compat             v1.0.4             A compatibility library for the proposed simplified password...
jakub-onderka/php-console-color       0.1                
jakub-onderka/php-console-highlighter v0.3.2             
jcalderonzumba/gastonjs               v1.0.3             PhantomJS API based server for webpage automation
jcalderonzumba/mink-phantomjs-driver  v0.3.3             PhantomJS driver for Mink framework
masterminds/html5                     2.2.2              An HTML5 parser and serializer.
mikey179/vfsStream                    v1.6.4             Virtual file system to mock the real file system in unit tests.
nikic/php-parser                      v3.0.2             A PHP parser written in PHP
paragonie/random_compat               v2.0.4             PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common       1.0                Common reflection classes used by phpdocumentor to reflect t...
phpdocumentor/reflection-docblock     3.1.1              With this component, a library can provide support for annot...
phpdocumentor/type-resolver           0.2.1              
phpspec/prophecy                      v1.6.2             Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage             2.2.4              Library that provides collection, processing, and rendering ...
phpunit/php-file-iterator             1.4.2              FilterIterator implementation that filters files based on a ...
phpunit/php-text-template             1.2.1              Simple template engine.
phpunit/php-timer                     1.0.8              Utility class for timing
phpunit/php-token-stream              1.4.9              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                       4.8.31             The PHP Unit Testing framework.
phpunit/phpunit-mock-objects          2.3.8              Mock Object library for PHPUnit
psr/cache                             1.0.1              Common interface for caching libraries
psr/http-message                      1.0.1              Common interface for HTTP messages
psr/log                               1.0.2              Common interface for logging libraries
psy/psysh                             v0.8.0             An interactive shell for modern PHP.
sebastian/comparator                  1.2.2              Provides the functionality to compare PHP values for equality
sebastian/diff                        1.4.1              Diff implementation
sebastian/environment                 1.3.8              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                    1.2.2              Provides the functionality to export PHP variables for visua...
sebastian/global-state                1.1.1              Snapshotting of global state
sebastian/recursion-context           1.0.2              Provides functionality to recursively process PHP variables
sebastian/version                     1.0.6              Library that helps with managing the version number of Git-h...
stack/builder                         v1.0.4             Builder for stack middlewares based on HttpKernelInterface.
stecman/symfony-console-completion    0.7.0              Automatic BASH completion for Symfony Console Component base...
symfony-cmf/routing                   1.4.0              Extends the Symfony2 routing component for dynamic routes an...
symfony/browser-kit                   v3.2.2             Symfony BrowserKit Component
symfony/cache                         v3.1.9             Symfony implementation of PSR-6
symfony/class-loader                  v2.8.16            Symfony ClassLoader Component
symfony/config                        v3.1.9             Symfony Config Component
symfony/console                       v2.8.16            Symfony Console Component
symfony/css-selector                  v2.8.16            Symfony CssSelector Component
symfony/debug                         v2.8.16            Symfony Debug Component
symfony/dependency-injection          v2.8.16            Symfony DependencyInjection Component
symfony/dom-crawler                   v2.8.16            Symfony DomCrawler Component
symfony/event-dispatcher              v2.8.16            Symfony EventDispatcher Component
symfony/expression-language           v3.1.9             Symfony ExpressionLanguage Component
symfony/filesystem                    v3.1.9             Symfony Filesystem Component
symfony/finder                        v3.1.9             Symfony Finder Component
symfony/http-foundation               v2.8.16            Symfony HttpFoundation Component
symfony/http-kernel                   v2.8.16            Symfony HttpKernel Component
symfony/polyfill-apcu                 v1.3.0             Symfony polyfill backporting apcu_* functions to lower PHP v...
symfony/polyfill-iconv                v1.3.0             Symfony polyfill for the Iconv extension
symfony/polyfill-mbstring             v1.3.0             Symfony polyfill for the Mbstring extension
symfony/polyfill-php54                v1.3.0             Symfony polyfill backporting some PHP 5.4+ features to lower...
symfony/polyfill-php55                v1.3.0             Symfony polyfill backporting some PHP 5.5+ features to lower...
symfony/process                       v2.8.16            Symfony Process Component
symfony/psr-http-message-bridge       v0.2               PSR HTTP message bridge
symfony/routing                       v2.8.16            Symfony Routing Component
symfony/serializer                    v2.8.16            Symfony Serializer Component
symfony/translation                   v2.8.16            Symfony Translation Component
symfony/validator                     v2.8.16            Symfony Validator Component
symfony/var-dumper                    v3.2.2             Symfony mechanism for exploring and dumping PHP variables
symfony/yaml                          v2.8.16            Symfony Yaml Component
twig/twig                             v1.31.0            Twig, the flexible, fast, and secure template language for PHP
webflo/drupal-finder                  0.2.1              Helper class to locate a Drupal installation from a given path.
webmozart/assert                      1.2.0              Assertions to validate method input/output with nice error m...
wikimedia/composer-merge-plugin       v1.3.1             Composer plugin to merge multiple composer.json files
zendframework/zend-diactoros          1.3.9              PSR HTTP Message implementations
zendframework/zend-escaper            2.5.2              
zendframework/zend-feed               2.7.0              provides functionality for consuming RSS and Atom feeds
zendframework/zend-stdlib             3.1.0              
DamienMcKenna’s picture

$ composer update --with-dependencies
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing symfony/cache (v3.1.9)
  - Removing psr/cache (1.0.1)
  - Removing symfony/expression-language (v3.1.9)
  - Installing symfony/expression-language (v2.8.16)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing symfony/finder (v3.1.9)
  - Installing symfony/finder (v2.8.16)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing symfony/filesystem (v3.1.9)
  - Installing symfony/filesystem (v2.8.16)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing symfony/config (v3.1.9)
  - Installing symfony/config (v2.8.16)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing drupal/console-en (1.0.0-rc14)
  - Installing drupal/console-en (1.0.0-rc15)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing dflydev/dot-access-configuration (dev-master ae6e713)
  - Installing dflydev/dot-access-configuration (v1.0.1)
    Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing drupal/console-core (1.0.0-rc14)
  - Installing drupal/console-core (1.0.0-rc15)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing drupal/console (1.0.0-rc14)
  - Installing drupal/console (1.0.0-rc15)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing zendframework/zend-diactoros (1.3.9)
  - Installing zendframework/zend-diactoros (1.3.10)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing phpunit/phpunit (4.8.31)
  - Installing phpunit/phpunit (4.8.32)
    Downloading: 100%         

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

And then..

$ drupal generate:plugin:metatag:tag --module='metatag_app_links' --group='app_links' --base_class='MetaPropertyBase' -y --multiple=FALSE --secure=FALSE


Fatal error: Call to undefined method Symfony\Component\Console\Formatter\OutputFormatter::escapeTrailingBackslash() in /Users/dmckenna/Sites/drupal/8/vendor/symfony/console/Helper/SymfonyQuestionHelper.php on line 57

So, still broken. Any thoughts? Is it a bug in Symfony?

jmolivas’s picture

@DamienMcKenn try updating also the Launcher to RC-15 by executing from outside of your drupal project root

drupal self-update
DamienMcKenna’s picture

Ah! Yes, thanks, that fixed the generator's problem starting.

How should I restructure the console/translations/* files?

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
4.74 KB

Minor tweaks to spacing, comments.

DamienMcKenna’s picture

  • DamienMcKenna committed 3797fed on 8.x-1.x
    Issue #2841737 by DamienMcKenna: Renamed the DrupalConsole commands.
    
DamienMcKenna’s picture

Status: Needs review » Needs work

I committed #19, putting this back to Needs Work as the string translations still need to be fixed.

jim22’s picture

Hi. I'm getting an error when using Drupal Console to generate custom metatags.

Thanks for any help.
Jim

Drupal Console 1.8.0
Drupal Core 8.5.6
MetaTag 8.x-1.6

Error: Call to undefined method Drupal\metatag\Command\GenerateTagCommand::getIo() in /app/vendor/drupal/console/src/Command/Shared/ModuleTrait.php on line 46 #0 /app/web/modules/contrib/metatag/src/Command/GenerateTagCommand.php(189): Drupal\metatag\Command\GenerateTagCommand->moduleQuestion(Object(Drupal\Console\Core\Style\DrupalStyle))
#1 /app/vendor/symfony/console/Command/Command.php(236): Drupal\metatag\Command\GenerateTagCommand->interact(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /app/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /app/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Drupal\metatag\Command\GenerateTagCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/drupal/console-core/src/Application.php(185): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /app/vendor/drupal/console/src/Application.php(64): Drupal\Console\Core\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /app/vendor/symfony/console/Application.php(148): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /app/vendor/drupal/console/bin/drupal.php(89): Symfony\Component\Console\Application->run()
#8 /app/vendor/drupal/console/bin/drupal(4): require('/app/vendor/dru...')
#9 {main}
Error: Call to undefined method Drupal\metatag\Command\GenerateTagCommand::getIo() in Drupal\metatag\Command\GenerateTagCommand->moduleQuestion() (line 46 of /app/vendor/drupal/console/src/Command/Shared/ModuleTrait.php).

andyg5000’s picture

@jim22's issue was caused by the console command classes extending the Symfony Command class instead of the Console command.

Here's a patch to fix that issue.

I'm not sure what needs to be done with Translations regarding [https://www.drupal.org/project/metatag/issues/2841737#comment-11895806], but if I figure that out, I'll throw another patch up :)

andyg5000’s picture

Status: Needs work » Needs review
hjuarez20’s picture

Hi, I have updated the commands using the latest version of Drupal Console (1.9.3)

DamienMcKenna’s picture

Honestly I've just been copying & pasting the files, rather than using the generator X-)

Could someone please give harold20's patch a try, if it works I'm happy to commit it.

  • DamienMcKenna committed 76a4b4c on 8.x-1.x
    Issue #2841737 by DamienMcKenna, andyg5000, harold20, jmolivas, jim22:...
DamienMcKenna’s picture

Status: Needs review » Fixed
Parent issue: » #3102475: Plan for Metatag 8.x-1.12

Committed. Thanks.

Status: Fixed » Closed (fixed)

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