How do i create a content type field using Drush or Drupal Console? I tried both ways but nothing seems to work. I am using Drush Commandline Tool 9.7.1 and Drupal Console version 1.9.4.

Drush: $ drush generate field poll_name

ArgumentCountError: Too few arguments to function Twig\Extension\StagingExtension::addFilter(), 1 passed in /home/muneebmukhthar/.composer/vendor/twig/twig/src/ExtensionSet.php on line 222 and exactly 2 expected in /var/www/html/drupal_8_minimal/vendor/twig/twig/src/Extension/StagingExtension.php on line 49 #0 /home/muneebmukhthar/.composer/vendor/twig/twig/src/ExtensionSet.php(222): Twig\Extension\StagingExtension->addFilter(Object(Twig\TwigFilter))

Drupal Console:

There is no direct command to generate a content type field in drupal console. I tried $ drupal generate:plugin:field as suggested somewhere which is used to create Generate field type, widget and formatter plugins inside a module, and not a content type field.

  • sorry drush generate field command throwing twig error was particularly for that drush verison, I downgraded drush to 9.0.0 and now it only allows me to create a field under a module. Which someway helps – KTM Mar 16 '20 at 9:42
  • Downgraded to drush 9.0.0 and tried some other versions of drush. No luck :( – FLY Oct 7 '20 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.