28

There's just one step, using module_enable(): $modules = array('module1', 'module2'); // Array of module names $enable_dependencies = TRUE; // Whether or not to enable dependant modules module_enable($modules, $enable_dependencies);


22

drush dl drupal --destination=/var --drupal-project-rename=www


18

The problem is in the data array change name by label: $role = \Drupal\user\Entity\Role::create(array('id' => 'client', 'label' => 'Client')); $role->save(); Or you can use: //your data array $data = array('id' => 'client', 'label' => 'Client'); //creating your role $role = \Drupal\user\Entity\Role::create($data); //saving your role $role-&...


17

I think you didn't select English in the first step, and probably your Internet connection is behind a proxy and I guess Drupal doesn't support it. You can select English and continue or: Go to Translation server and download the specific language, the Spanish for example Copy the download file in sites/default/files/translations Continue with ...


16

Please make sure your webserver (nginx/apache) is using the same PHP version as your cli one. For example, you may encounter this issue if your cli PHP version is PHP 7.1 and your webserver is using PHP 7.0.


15

NOTE The issue described in the Question has now be fixed in the latest Drush version. No, Drush does not need to be installed as root. I've submitted Drush pull #2246 to update the current Drush install instructions. This install method fixes the issue as per Drush pull #2246: # Download latest stable release using the code below or browse to github....


15

I suspect you are installing Drupal (or at least trying to) on a server running PHP 7.4, which is not currently compatible with the latest version of Drupal (8.8). There is an issue on drupal.org right here that details the current problems, including yours: https://www.drupal.org/project/drupal/issues/3086374 . The highest supported version of Drupal 8.8 ...


14

Nothing wrong with that. It is recommend to have the config folder outside of the public web folder; Drupal just doesn't have that. To keep the installation simple for non-experienced users, it puts that folder in the files folder, which has to be writable anyway. Just create that folder and give Drupal write permission to it; you'll be fine.


13

The WYSIWYG module is not compatible with CKEditor 4, because CKEditor 4 uses double quotes " around it's version string, where CKEditor 3 used single quotes '. This breaks the version detection regex in the WYSIWYG module. You could use CKEditor 3, like Bruno suggests, or you could patch the WYSIWYG module like described here https://drupal.org/comment/...


13

This is an nginx configuration issue and discussed intensely on this page Yet curiously no solid solution could be offered. Some guy on an other page proposed a solution. I applied that proposed solution and can confirm that in works! To apply proposed solution go to your nginx configuration file under /etc/nginx/sites-available/ directory on Ubuntu and ...


13

There are a few things you can do to help debug your drush. Here is what you can try: Debug output Use drush cc all -vvv This will provide you with some valuable information in terms of what Drush is doing in the background and maybe show you the actual error message. Check your settings.php Depending on your setup you may be passing in environment ...


12

You can do this in hook_requirements, from the documentation: During the 'install' phase, modules can for example assert that library or server versions are available or sufficient. Note that the installation of a module can happen during installation of Drupal itself (by install.php) with an installation profile or later by hand. As a consequence,...


10

I restored a backup from production locally and tried to just move things and hit admin/modules or to run registry_rebuild() but it didn't stop fatal errors from being thrown. This makes sense to me since some modules may use includes or whatever in their hook_init(), or you may have a menu router path set that depends on a module or include that Drupal can'...


10

Variables are cached, so deleting manually is fine so long as you invalidate that cache, e.g. db_delete('variable') ->condition('name', 'mymodule_%', 'LIKE') ->execute(); cache_clear_all('variables', 'cache_bootstrap');


10

Drupal 8 requires PHP 5.5.9 or higher (for short array syntax among other things). You'll need to upgrade your version of PHP. Source: System Requirements


9

Here is how you would do it with a database update using hook_update_N from another enabled module's *.install file. Then you can visit /update.php in the browser or run $ drush updb on the command line to have this code fired. /** * Enable module1 and module2. */ function MYMODULE_update_7101() { // Array of module names. $modules = ['module1', '...


9

So You Want to Build a Drupal Distro Take a look at Packaging a distribution on Drupal.org Here are the steps: Assemble the pre-requisites Create a Drush Make file Convert to a Drupal.org-specific Drush Make file Build and verify it works Commit your code to Git Release your code on Drupal.org Maintain your distribution Another great tutorial How to ...


9

No module needs to implement every hook. You can use hook_update_n() and not have a hook_install() function just fine. You'll probably at 1 point want to define hook_schema() for these tables. An easy tool to get the "drupal" schema for any mysql table (already defined) in your mysql database is the Schema module. Schema documentation: hyperlinked ...


9

update.module doesn't know about git. It only understands .info(.yml in D8) files. And .info.yml files only get their version as part of the package building process. If you look at your system.info.yml, it doesn't say anywhere that it is beta6. There is a module called git deploy, that is trying to fill that gap and extracts version information from git ...


8

If you don't have shell access the Devel module provides such functionality. Install it and visit mysite.com/devel/reinstall.


8

Use this: drush pmi --fields=type,project,title,status,path --format=table|sort This gives you a module list with five columns: First is the type of project: module or theme. Second one is the module project, for exampe views, logintoboggan, admin_menu, etc. The third one is the installation status: enabled (in use), disabled (not in use but install info ...


8

It's because by default port 22 (SSH) comes open in your EC2 security group, but port 80 (HTTP) is not open. You need to edit your security group. To get there, in your EC2 list, scroll all the way to the right and click on the blue security group name. You will be taken to your security group settings page, for inbound, add Custom TCP Rule of port 80 PS:...


8

The current advice is to set this via config: \Drupal::configFactory() ->getEditable('system.theme') ->set('default', $theme) ->save(); The previous method using ThemeHandlerInterface::setDefault() is now deprecated. You might need to install it first too, I'm not sure. In case you do: \Drupal::service('theme_installer')->install(['...


7

That occurs because Drupal can't connect to its database Ensure you have: settings.php in your Drupal /sites/default folder. settings.php must be readable by the webserver user and contain valid database connection string credentials for that server. Make sure the base_url is either default commented out or valid for that domain. See ...


7

This isn't so much an answer as it is an expansion on the previous answer. I found these two links very helpful in figuring out what the system needs for custom fields to be added to your custom module node type. Best: http://www.sitepoint.com/creating-a-new-drupal-node-type/ Good additional info: http://public-action.org/content/drupal-7-field-api-drupal-...


7

A year or so ago I was working on a Drush command to export a working site as an installation profile. I haven't worked on it for a while, but it was my intention to use something like the Configuration Management module, or perhaps Drush CTools Export Bonus to include site configuration information with the installation profile. If you are hand-generating ...


7

That's a known issue right now. There's no way right now to hook into that automatically. And it came up a few times already here too. See this question for example: Module uninstall dependencies Beside a form or a drush command to do the cleanup, there really isn't much that you do right now, other than improving core. What I'd like to see is a message on ...


7

Not sure exactly what's going on there but I can reproduce it using the installation instructions. The problem is related to the execution path (haven't looked any deeper). If you move out of the folder you downloaded drush into and execute, it'll work. (cd ~/..; Michael/drush core-status). That's probably why it works when you su - your working directoy ...


7

Checking https://packagist.org/packages/drupal/drupal for the versions available there is NO 7.x version. Drupal 7 has no composer.json for this to command to work. You can use one of the other 2 methods mentioned on https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies Using https://github.com/drupal-composer/...


7

For Ubuntu 16.04 I had to run the following commands to adjust the PHP version used by Apache: sudo a2dismod php7.0 sudo a2enmod php7.2 sudo service apache2 restart


Only top voted, non community-wiki answers of a minimum length are eligible