21

What is the status of CiviCRM working with Drupal 8? And how can I help in terms of testing or funding this development?

  • 1
    The previous answers are now almost a year old. Where can I find a more recent status update? – David-B Mar 14 '17 at 14:48
19

There's now a beta version of a mostly automated installer at https://gitlab.com/roundearth/drupal-civicrm-project. You can also use it to add civi to an existing drupal 8 site as long as you installed drupal 8 using composer originally. See https://www.mydropwizard.com/blog/better-way-install-civicrm-drupal-8. (update Feb 2019)

You can find the code in its current state at https://github.com/civicrm/civicrm-drupal-8 (link updated Dec 2018)

There are bunch of issues on JIRA

There is a channel on Chat here

  • Thanks for this Pete. Do you know if D8/Civi can be spun up with buildkit? – Coleman Aug 4 '15 at 12:32
  • Eileen's done some work on that, not sure if it's ready yet or not – Jonathan Aug 4 '15 at 14:08
  • Yes we totally understand the need to get D8 and civi firing up on BuildKit and having been putting some time in to this but not fully completed. Current focus (and funding) is on ensuring CiviCRM works with beta14 – petednz - fuzion Aug 4 '15 at 20:41
  • Note the first link about the code for the drupal module part is now github.com/civicrm/civicrm-drupal-8 as of May, 2018, instead of github.com/civicrm/civicrm-drupal/tree/8.x-master. – Demerit Dec 30 '18 at 20:12
  • Thanks Demerit - have updated link – petednz - fuzion Dec 30 '18 at 21:24
13

Active Development has restarted on the Drupal 8 version. It is possible to get it installed now, although it takes a slight different process than with Drupal 7.

Assuming you have Drupal 8.2.5 installed.

Download and install the 8.x-3.x-dev version of the Libraries module: https://www.drupal.org/project/libraries

Download the most recent version of CiviCRM 4.7 from CiviCRM.org , or if your a little more adventurous, the master branch from github.

Put CiviCRM core in /libraries folder of your Drupal 8 installation.

Delete the Drupal 7 modules from this download which would now be in /libraries/civicrm/drupal . You can delete the whole drupal folder.

Next get the 8.x-master branch of the CiviCRM Core drupal module

Put this in your standard Drupal 8 modules directory, /modules/civicrm

Now log in to your Drupal 8 site and goto /admin/modules

Enable CiviCRM, but do it by itself, do not enable any other modules at the same time.

This will attempt to install CiviCRM in the same database as your Drupal installation.

You will get some feedback if it has issues connecting to the database. If you get a "cannot connect to database" message, try the one line temporary fix documented in this issue: https://issues.civicrm.org/jira/browse/CRM-19835 There will be a fix soon for this issue

Now you will have CiviCRM installed. In my experience, there was an error at the root civicrm page at path /civicrm , due to something with the Dashboard. To fix this you must simply set the default organization and email address and From Name here: civicrm/admin/domain?action=update&reset=1

After that, all the CiviCRM pages will load, you will see the CiviCRM menu.

There are some issues that are being worked out, but at this point CiviCRM is usable. We need people testing this and documenting issues so that they can be resolved.

  • Great to hear! Congrats to all involved. – Joe Murray Jan 23 '17 at 16:39
9

See answer from @jackrabbithanna for current status.

tl;dr : It's not yet production ready, and the list of things you can help on is in JIRA at https://issues.civicrm.org/jira/browse/CRM-17652?filter=23012 . Additionally, please create additional issues and mark Label them drupal-8.

Building on the previous work, Allen Shaw made some progress recently with assistance from Tim, Coleman and Nicolas at the Vail Colorado sprint hosted by Nicolas Ganivet.

The navigation menu and dashboard are now working.

For convenient assistance with developing, it is now possible to install D8 with CiviCRM using

civibuild create d8-master

Also, the new cividev environment builder ( https://github.com/civicrm/civicrm-buildkit-vagrant/blob/master/README.md) can configure a VirtualBox using Vagrant on your local machine with this or other builds supported by buildkit.

However, various issues need to be resolved before CiviCRM can be run in production with D8 as of mid-February 2016.

3

You could also try the RoundEarth distribution: https://gitlab.com/mydropwizard/roundearth-drops-8

"RoundEarth is a template for building a website for a nonprofit organization, based on Drupal 8 and CiviCRM."

0

As there are a lot of (often outdated) setup instructions floating around, here the attempt to curate a summary for a step-by-step guide.

To install CiviCRM into your existing Drupal 8 site using composer:

  1. Open a shell in the root folder of your Drupal 8 instance, from where you would usually run composer
  2. Use the following commands to install civicrm

// (view gist)

CIVICRM_VERSION=5.3.1

# Repositories aren't inherited from requirements, so we have to put this one from civicrm-core/composer.json again
composer config repositories.zetacomponents-mail vcs https://github.com/civicrm/zetacomponents-mail.git

#
# RE-RUN THE COMMANDS BELOW TO UPGRADE CIVICRM (after first changing $CIVICRM_VERSION)
#
# (NOTE: if you do an upgrade, remember to do the database updates on the site afterward
#  via /civicrm/upgrade?reset=1 or 'drush cvupdb')
#

# Require civicrm-core at the requested version.
composer require "civicrm/civicrm-core:$CIVICRM_VERSION"

# Run 'bower install' to get Javascript stuff
(cd vendor/civicrm/civicrm-core && bower install)

# Download the latest Drupal package to copy some stuff that's
# generated by the build and included in release tarballs.
wget -O /tmp/civicrm.tar.gz https://download.civicrm.org/civicrm-$CIVICRM_VERSION-drupal.tar.gz
tar -xzf /tmp/civicrm.tar.gz -C /tmp
# Copy the 3rd party dependencies (Whaaaat? Someone who's been doing CiviCRM for a while
# will need to explain this to me :-) Why not use composer for pulling in these too?)
cp -r /tmp/civicrm/packages vendor/civicrm/civicrm-core/
# Setup the civicrm-version.php
cat /tmp/civicrm/civicrm-version.php | sed -e 's/Drupal/Drupal8/' > vendor/civicrm/civicrm-core/civicrm-version.php
# Copy sql
cp -r /tmp/civicrm/sql vendor/civicrm/civicrm-core/
# Copy some misc other things
cp /tmp/civicrm/civicrm.config.php vendor/civicrm/civicrm-core/
cp /tmp/civicrm/CRM/Core/I18n/SchemaStructure.php vendor/civicrm/civicrm-core/CRM/Core/I18n/
cp /tmp/civicrm/install/langs.php vendor/civicrm/civicrm-core/install/
# Clean-up
rm -rf /tmp/civicrm.tar.gz /tmp/civicrm
  1. Copy the relevant files from the vendor/civicrm-core folder to the web/libraries/civicrm folder, so that they can be accessed from the web server (this might only be necessary for Apache servers?):

// (view source)

# Copy CiviCRM assets
asset_source=./vendor/civicrm/civicrm-core
asset_dest=./web/libraries/civicrm
mkdir -p $asset_dest
rsync -mr --include='*.'{html,js,css,svg,png,jpg,jpeg,ico,gif,woff,woff2,ttf,eot} --include='*/' --exclude='*' $asset_source/ $asset_dest/
rm -rf $asset_dest/tests
cp -r $asset_source/extern $asset_dest/
cp $asset_source/civicrm.config.php $asset_dest/
cat << EOF > $asset_dest/settings_location.php
<?php

define('CIVICRM_CONFDIR', '../../../sites');
EOF
  1. Install civicrm-drupal-8, the Drupal 8 Module integrating CiviCRM with Drupal through composer: composer require civicrm/civicrm-drupal-8. (The module will automatically be installled at the proper location in Drupal's folder structure at modules/contrib/civicrm)
  2. Go to the "Extend" page in Drupal's administration pages (/admin/modules) and install the CiviCRM module
  3. Log out and log back in again (this seems necessary till date due to CRM-19878?)
  4. You may need to (??) add the following to your civicrm.settings.php (web/sites/default/civicrm.settings.php:

//

$civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . 'libraries/civicrm/';
$civicrm_paths['cms.root']['path'] = '/var/www/YOUR_DRUPAL_FOLDER/web/';

Based on:

More information may sometime be available at

  • 1
    Thanks but this actually isn't the latest info. See at the top of the highest rated answer above. There's a beta installer now at gitlab.com/roundearth/drupal-civicrm-project – Demerit Feb 12 at 16:49
  • 1
    Yes, but as far as I understand, this will create an initial project of a fresh Drupal8+CiviCRM, so it won't be possible to use this to add Civi to an existing Drupal system? – Cibes Feb 12 at 22:14
  • Fair point - although my understanding is the plans for drupal are to move towards promoting composer more to install drupal, and if it was originally installed that way then it might be compatible. But maybe you're right not yet. – Demerit Feb 12 at 22:48
  • 1
    According to an article from 2 days ago, if you used composer to install drupal you can add civi to an existing drupal with composer require roundearth/civicrm-composer-plugin civicrm/civicrm-drupal-8. See mydropwizard.com/blog/better-way-install-civicrm-drupal-8. @Cibes – Demerit 2 days ago

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.