Questions tagged [drupal-console]

Use it for the suite of tools run from a command line interface to generate boilerplate code: the Drupal Console.

Filter by
Sorted by
Tagged with
10
votes
4answers
5k views

Is Drupal Console aimed to replace Drush?

Is Drupal Console (which is available for Drupal 8) aimed to totally or partially replace Drush?
8
votes
2answers
2k views

Define module as feature

Creating a module with Drupal Composer asks me: Define module as feature (yes/no) What does it mean?
6
votes
2answers
3k views

How to run Drupal console command from code?

I have found a lot of documentation on how to run Drush commands from code, but I'm specifically looking on how to run a Drupal Console command from code. I have some experience in Symfony and I know ...
4
votes
2answers
8k views

Rebuild node access permissions

How can I rebuild the node access permissions? drupal node:access:rebuild returns the following error message. [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands ...
4
votes
1answer
221 views

Drush or Drupal console command to list modules with security updates?

Is there a command for Drupal 8.x that shows available updates? I added forms_steps 1.1 that has an SA and a security update required in the Web UI, which is saying to update to 1.2 I tried drush pm:...
3
votes
3answers
6k views

How do I install Drupal Console to my project with Composer?

I am running my Drupal 8 project under Acquia Dev Desktop 2 and just got Composer installed. How can I add the Drupal Console to my project?
3
votes
3answers
7k views

How do I disable a module?

I am trying to disable modules in Drupal 8, and I found some solution like Drupal console, but I am not sure how to use it with XAMPP. I am unable to understand how I can disable a Drupal 8 module. ...
3
votes
3answers
8k views

views exposed filter to have dropdown of entity reference in cutstom entity

I generated with drupal console utility my own module and content entity code. After I added a user entity reference field and a taxonomy term entity reference field. Now I'm listing my content with ...
3
votes
3answers
722 views

How to properly set up Drupal Console on Windows 7

I have been trying to set up Drupal Console for quite some time now on Windows 7; however, there always seems to be some kind of error which I am unable to solve. I have installed Drupal Console via ...
3
votes
1answer
967 views

Change view & edit route or URL of Entities generated by Drupal Console

I have generated a custom entity using Drupal Console. drupal generate:entity:content However, there is one serious problem. All the default route for the various operation related to that entity ...
3
votes
2answers
4k views

Execute a custom function on 'user register' or 'login'

I am new to Drupal. I want to execute my custom function every time when user registers or logins to my site. How can I do this?
3
votes
1answer
751 views

Get a list of available migration destination plugins

how can I get all available migration destination plugins? A way to ask with drupal console? like listed on Migrate destination plugin examples
3
votes
2answers
4k views

How to configure programmatically a unique constraint on several fields of a custom entity?

How could I configure a unique constraint on several fields of a custom entity I have already created with drupalconsole. The purpose is not allowing insert of two record of the same entity having ...
3
votes
1answer
29 views

Undo/redo drupal console generate:plugin:block?

I ran drupal console generate:plugin:block and made a mistake. I'd like to run it again, but I get this error: 'block' entity with ID 'my_block' already exists. I've removed the source file that ...
3
votes
2answers
553 views

Which cache bin to clear after changing services

I made some changes to own services and now I get an error about invalid arguments. When I clear all caches everything works fine. I don't want to clear all caches in my production environment. Which ...
3
votes
1answer
92 views

Drupal console “settings:set” not working or I am doing it wrong

I wanted to use Drupal console to change some settings on a site: To set the default 403 page to "/user/login" To set user registration permission to "admin only" Following the instructions here, ...
3
votes
1answer
380 views

Render a view in a given language in a custom command

I have written a Drupal Console command that creates a huge batch of HTML snippets. This is done by rendering a view programmatically (as in this StackExchange answer) The task Now I have to create ...
2
votes
2answers
4k views

How to update core and all modules and themes from CLI?

On a LAMP environment I have a Drupal 8.5.6 website which is nearly all-core with the Bartik theme and a few stable contrib modules. Nothing is customized and I have daily backups so I don't "fear" of ...
2
votes
2answers
1k views

How do I create a sub-theme from CLI? [closed]

How do I create a sub-theme using Drupal Console or Drush 9? I looked at Creating a Drupal 8 sub-theme, or sub-theme of sub-theme and the documentation of drupal generate:theme, but I didn't find ...
2
votes
1answer
308 views

Installing latest drupal console RC via composer

I'm trying to install drupal console latest release candidate globally via composer. I run $ composer global require drupal/console:~1.0.0@rc But I get the following error: Your requirements could ...
2
votes
1answer
627 views

Why are most of the commands missing?

Most of console commands are missing from the output of drupal list. I am using Drupal Console version 0.11.3, which outputs the following error message. [WARNING] In order to list all of the ...
2
votes
1answer
271 views

How to configure multisites for the console?

Most of console commands are not listed when using drupal list Drupal Console version 0.11.3 It issues a warning like so: [WARNING] In order to list all of the available commands you should ...
2
votes
1answer
2k views

How to add an specific action button in views?

Is there any way to add a specific action button in view module for an entity I've created programmatically. More specifically, I want to make a search of my entity in view, and having beside each ...
2
votes
1answer
480 views

Are use Drupal\Core\Form\FormStateInterface statements for a Drupal 8 hook required?

This may be obvious to expert D8 users, but; If I am implementing hook_form_alter in Drupal 8, the hook definition looks like this: hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $...
2
votes
0answers
215 views

Drupal console report that mysql extension needs to be installed

Hi I am a novice at this stuff so that might explain the following: During my Drupal 8 install I received the following: The libmysqlclient driver version 5.6.26 is less than the minimum ...
1
vote
1answer
857 views

Export Paragraph bundles

I know drupal config:export:content:type is for exporting a content type. Is there a way to do this for a Paragraph bundle? drupal config:export:paragraph:type doesn't work.
1
vote
2answers
359 views

How do I export a content type, views as a single module

I've a view, content type, field collection, flexslider to satisfy a single user case. May I know how to export all these three as a single module.
1
vote
1answer
338 views

How do I uninstall and remove Drupal Console from my project?

1 year ago, I installed the Drupal Console module on my site. This module seems to be completely abandoned, so I'm asking my question here. https://www.drupal.org/project/console I had installed this ...
1
vote
2answers
605 views

Composer installation of drupal console missing functions

I've been attempting to install drupal console for the first time ever. I was looking for a means of creating boiler plate modules, blocks etc. My issue is when I have finished the installation ...
1
vote
1answer
356 views

How do I display all available field types?

I want generate an new form in a custom module via the generate:form command. In this step, I must enter a field type. How can I get all available field types?
1
vote
3answers
938 views

Why do I get an error about the modules/custom directory not existing?

I have installed Drupal 8 on Ubuntu. All works well, but I cannot create a new module using Drupal Console. When I run drupal generate:module, I get the following error message. [...
1
vote
1answer
632 views

Create a distribution

How is it possible to create a new Drupal distribution based on site that I already built? I've already exported the content types using drupal config:export:content:type MYCONTENTTYPE --module ...
1
vote
0answers
388 views

How do I generate a custom content entity bundle?

I created a custom content entity with Drupal console version 1.9.2. Everything is working fine. To use all the configuration and settings of my custom entity type in different bundles, I want ...
1
vote
0answers
735 views

Drupal console missing some commands

I just install Drupal Console, then adding it to my pre-installed Drupal 8 with this into the drupal folder: php ~/bin/composer.phar require drupal/console:~1.0 --prefer-dist --optimize-autoloader ...
1
vote
1answer
67 views

How do I download a specific version of a module?

The official documentation for Drupal Console says that the arguments for drupal module:download are the following. drupal module:download [arguments] [options] is there an argument or option to ...
1
vote
1answer
38 views

Why are the commands implemented by a custom module still listed after uninstalling it?

I registered a new command via Drupal Console using drupal generate:command. I associated the command with a custom module, but after uninstalling the module and removing the module folder, the ...
1
vote
0answers
278 views

How can I add fields to an entity?

I'm coming from a do-it-yourself database design background, so bare with me. Let's say I want two database tables, one of car manufacturers, and one of car models. The first table, car_make, would ...
1
vote
0answers
467 views

How to unit test custom console ContainerAwareCommand in Drupal 8

I have a custom console command that extends Drupal\Console\Command\ContainerAwareCommand. Inside the command I need to access the container to fetch a service. But now I'm struggling with figuring ...
0
votes
3answers
831 views

'Edit Own Content' permission missing in custom entity

I have generated a custom entity using Drupal Console. drupal generate:entity:content The entity doesn't have the permission edit own content which we usually have in node types etc... The entities ...
0
votes
1answer
489 views

How do I install without having these errors? [closed]

So far, Drupal Commerce is the best module for e-commerce on Drupal. But now Drupal 9.0.0 was released, and when I want to install Drupal Commerce on Drupal 9, both way is out of luck. Both way I ...
0
votes
1answer
48 views

How can I get single keys in multi-item config objects using debug:config?

For example, in drush I can run drush cget search_api.server.iges_solr backend_config.connector_config.port and get a useful answer. ('search_api.server.iges_solr:backend_config.connector_config....
0
votes
1answer
309 views

Clearing cache takes “long time”

I am absolutely new in Drupal. I am trying to set up my first "Hello world" module and I am playing with it. Every time I clear cache using Drupal Console, it takes 15 seconds, which is an eternity ...
0
votes
1answer
650 views

Migrate content from drupal8 to drupal8 programmatically with Node::load and Node::create

Basicly I want to migrate content from one drupal8 instance to another. they are mostly identical with some small changes. first step is to migrate the content type via drush gen module module and ...
0
votes
3answers
726 views

Drupal console set site:mode

I installed a site use composer with command composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction I would like to set site mode to dev. If site ...
0
votes
1answer
34 views

Argument 2 passed to Drupal\Console\Command\Test\RunCommand::__construct() must be an instance of Drupal\simpletest\TestDiscovery

I'm trying to install drupal console with Drupal 9.0.5, so I ran this command: composer require drupal/console:~1.0 However when I try run the drupal command with any arguments I get this error: root@...
0
votes
1answer
707 views

How come Drupal Console is not downloading all commands?

When adding Drupal Console using Composer, we are finding that the list of commands is not complete. How can I resolve the issue? Installation steps: change to root directory (/local/path/drupal-...
0
votes
3answers
3k views

Unable to uninstall a module

When I try to uninstall the "Commerce license" module, the following error appears : drupal module:uninstall commerce_license [ERROR] SQLSTATE[42S02]: Base table or view not found: 1146 Table ...
0
votes
1answer
100 views

How can I resolve these errors when updating the module?

I want to update Drupal Commerce to 8.x-2.0-beta7 from a clean, Composer-based installation of 8.x-2.0-beta6, following the documentation on http://docs.drupalcommerce.org/v2/getting-started/update....
0
votes
0answers
32 views

An AJAX HTTP error occurred during the Drupal module update

On Druapl 9.1.5, during the Metatag 8.x-1.16 update from the site it gave the following: Debugging information follows. Path: /core/authorize.php/core/authorize.php?batch=1&id=477&op=do_nojs&op=do ...
0
votes
0answers
120 views

How do you get the current directory in a command method?

In a standard Drupal 8 environment, the current working directory is override and becomes the document root of the site. This is a bit troublesome for Drupal Console command implementations that wants ...