by David Snopek on February 12, 2019 - 2:26pm

One the most popular articles on our blog is an article I wrote a year and half ago about how to install CiviCRM on Drupal 8.

The method described there worked (and still more-or-less works), but it's... a mess.

It involves running a dozen or so commands, and is pretty easy to get wrong. All of this is just to get code assembled in such a way that you CAN install it.

I'm happy to announce that you can now do this in just a single command!

There's still some little issues and bugs with running CiviCRM on Drupal 8 that need to be manually worked around, but getting over that first hurdle of simply allowing you to install it in the first place should be significantly easier with this new method.

Read the full article to find out how!

Background: Why is this hard?

The biggest problem is that both Drupal 8 and CiviCRM depend on some of the same PHP libraries, for example, Symfony.

In PHP, you can't define the same class twice (this would be a fatal error) and you certainly can't define the same class twice at two different versions (for example, one version for Drupal and one for CiviCRM).

So, you couldn't just copy CiviCRM with all its dependencies into an instance of Drupal, because some of those dependencies would conflict with what's already in Drupal.

And, unfortunately, you couldn't just make a special CiviCRM bundle that's "optimized" for a particular version of Drupal 8, because each Drupal 8 site is potentially unique: you can update the PHP libraries used by a Drupal 8 site (for example, upgrading Symfony to a newer version) or add new PHP libraries that could conflict.

The Magic of Composer

Composer is a tool that's used by PHP applications and libraries to find and download a compatible set of dependencies.

For example, CiviCRM needs Symfony 2 (version 2.8.44 or greater) or any version of Symfony 3. Drupal 8.6.9 needs Symfony 3.4 (version 3.4.14 or newer), although, soon it will be possible to use Drupal 8 with Symfony 4 as well.

Using composer, you can say, "I need Drupal 8.6.9 and CiviCRM 5.10.0" and it can pull in a version of Symfony that works for both.

If your Drupal site used Symfony 4 (because some Drupal module needed it), it would error out and say you need to either remove that module (so Symfony can be downgraded to Symfony 3) or remove CiviCRM.

That's why composer is so heavily involved in getting Drupal and CiviCRM to work together!

The peculiarities of CiviCRM

Of course, that's not the whole problem, because otherwise it would have been possible to solve this with a single composer command years ago.

CiviCRM has been around for over a decade (which is a lifetime ago in the PHP ecosystem), and still has some legacy pecularilies that need to be accounted for..

Namely, CiviCRM depends on going through a non-composer-y build process to generate a "release" that is actually usable.

Some of those things that need a build process could be reworked in a way so that they didn't need it, and others could be done in a composer-compatible way, such that CiviCRM would work like any composer library. Work is being done on that, but those are hard problems which will take time to solve.

TL;DR - What are the commands?

Alert: There are now official CiviCRM docs on how to install CiviCRM on Drupal 8. The instructions here are no longer recommended.

Heh, alright! Time for the actual actionable steps. :-)

First, you need to have the following installed:

And, make sure that you have a recent version of Composer! A couple of people have tried to use this process with older versions and have experienced issues. (In general, you shouldn't be using a composer that's older that 90 days - the Composer eco-system evolves quickly!)

Then, to create a new Drupal 8 site with CiviCRM:

# replace 'some-dir' with the directory to create
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction

Or, to add to an existing Drupal 8 site (assuming you used the best practice method of starting from the drupal-project composer template or the drupal/recommend-project composer template):

composer require civicrm/civicrm-asset-plugin civicrm/civicrm-drupal-8 civicrm/civicrm-packages

If you have a Drupal 8 site that isn't composerized, well, you're going to need to convert your site.

I'd recommend creating a new codebase (using the 'composer create-project' command above), adding all the modules/themes/libraries from the old codebase, and then switching the site to the new codebase. Assuming you didn't forget to copy anything over, that should work, but definitely keep a backup.

Installing CiviCRM

Once you have the code in place using the commands above, you'll actually need to install CiviCRM. Due to some bugs in CiviCRM for Drupal 8, there's a bunch of caveats and extra steps associated with that.

I've documented some of the steps on the project page for 'roundearth/drupal-civicrm-project':

https://gitlab.com/roundearth/drupal-civicrm-project#installing-civicrm

Hopefully, all these bugs will be fixed in time.

The good news is that the composer project template will always pull in the latest versions of CiviCRM and its Drupal 8 integration, so these steps should be able to remain the same, and will just start working better as those bugs get fixed. :-)

How does it work?

There are two parts to this:

It does the following:

  1. Run's Bower to pull in Javascript and CSS dependencies
  2. Downloads a release of CiviCRM and copies in the missing files generated by the usual build process
  3. Downloads any requested CiviCRM extensions
  4. Copies any web assets from CiviCRM (which is installed in the vendor directory, which isn't web accessible) into the web root

In case you're curious, or want to help improve it, here's where all the most interesting code lives:

https://gitlab.com/roundearth/civicrm-composer-plugin/blob/master/src/Handler.php

(UPDATE 2020-04-21: Going forward, please use the civicrm/civicrm-asset-plugin and participate with the CiviCRM community to improve it!)

Conclusion

One of the main challenges in improving CiviCRM on Drupal 8, is just getting it installed for developers who might want to help.

We've been involved in the effort to port the Webform CiviCRM module to Drupal 8, which has also faced this same challenge.

That's why a small part of the development of this new method was funded via the donations that were made to that effort. The rest was just part of our efforts in maintaining Roundearth, a Drupal 8 and CiviCRM platform for non-profits.

We're hoping this will help, not only with getting CiviCRM installed on Drupal 8, but also help to accelerate development. :-)

Want to read more articles like this?

Subscribe

Subscribe to the myDropWizard.com blog and recieve e-mail updates when new articles are published!

Comments

I get this error about half the time when running
composer require roundearth/civicrm-composer-plugin civicrm/civicrm-drupal-8

I found that if I just repeated the command it went through OK.

However, I have not so far been able to enable the CiviCRM module.

Drush fails. Enabling through the Drupal interface results in an error

Failed opening required '\vendor\civicrm\civicrm-core/packages/DB.php

It seems as though the composer plugin failed to copy over the civicrm 'packages' code.

If you just run 'composer civicrm' do you get any error messages?

That might give some clues as to why it can't copy over that code.

I create the Drupal site:
composer create-project drupal-composer/drupal-project:8.x-dev drupalsite --no-interaction
Then cd into 'drupalsite' folder.
If I run 'composer civicrm' I get:

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "civicrm" is not defined.

That's really weird! Either it didn't install the plugin, or you have a really old version of composer. Can you run 'composer --version' and see what version you have?

Composer version 1.9.0 2019-08-02 20:55:32

Hm. Well, that version should work!

What about 'composer show roundearth/civicrm-composer-plugin'? If the plugin is installed, it should provide the 'civicrm' and related commands. If it's not, though, that may be beyond my composer knowledge - I have never had a situation where a composer plugin silently failed to load. I'd expect at least an error or something.

Maybe a PHP version thing? What PHP version are you using on the command-line?

Ran the composer require roundearth/civicrm-composer-plugin civicrm/civicrm-drupal-8

Got

Installation failed, reverting ./composer.json to its original content.

[RuntimeException]
Unable to extract: C:\Users\michael.chaplin\AppData\Local\Temp\dru70BA.tmp

Ran composer require roundearth/civicrm-composer-plugin civicrm/civicrm-drupal-8 again
Got
Using version dev-master for roundearth/civicrm-composer-plugin
Using version ^5.17 for civicrm/civicrm-drupal-8
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing civicrm/civicrm-drupal-8 (5.17.4): Loading from cache
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles

Tried composer civicrm
Got
[civicrm-composer-plugin] Running bower for CiviCRM...
> [civicrm-composer-plugin] Downloading CiviCRM 5.17.4 release...
> [civicrm-composer-plugin] Extracting CiviCRM 5.17.4 release...

[RuntimeException]
Unable to extract: C:\Users\michael.chaplin\AppData\Local\Temp\druD9A7.tmp

php -v gives PHP 7.1.11 (cli)

Hm, ok! I think we're getting somewhere now. You're running Windows, and the error message is:

Unable to extract: C:\Users\michael.chaplin\AppData\Local\Temp\dru70BA.tmp

I think that's some issue with the CiviCRM plugin having trouble extracting a ZIP file on Windows. 

I made an issue in the GitLab project:

https://gitlab.com/roundearth/civicrm-composer-plugin/issues/7

If anyone with some PHP skills and access to a Windows box can dig into that, I'd really appreciate it! Otherwise, I can dig up a Windows VM eventually.

I think this is a Windows issue. I followed this recipe and have got a local copy of D8.7.7 + CiviCRM 5.17.4 running under Acquia DevDesktop

https://gist.github.com/demeritcowboy/e1a0b6dbe8149e4f3e04510cf4c3ae80

Thanks for your support David

Thanks for that link! The notes there could help solve this in the plugin. ;-)

I've successfully installed the composer script, drupal backend works no problem, so I've enabled civi 3 modules but all I got is error 500 when clicking on Civi shortcut.
I'm running mamp with php 7.2.10 and mysql 5.7.23
Any help appreciated

Can you look in your PHP or webserver logs to see what the actual error is?

Hopefully, that will help point to a solution.

Thanks guys for all the help you provide here. I went through a bunch of hiccups and I am now able to see the Civicrm link in the Drupal menu. However, when I click on it, I do not get taken to the normal civicrm menu bars. I do not see the menus at all. If I go to individual links (like add contacts ..), I can do that. I am not even able to set the Resource URL. The civicrm interface is messed up. It is as if there are no styling at all. I went to the database and update the Resource URL in civicrm_navigation table but that did not solve it. I opened up all the permissions to the folders. That did not do it.
I am installing on debian 9. I used this setting : composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir
The other one did not work at all.

Any help with this is very much appreciated.

Thank you.
Nabil

PROBLEM: Composer Update gets RunTimException on /vendor/zetacomponents/mail/src

DETAILS: I am working on installing Drupal 8 with CiviCRM on Pantheon. I successfully set up D8 using Pantheon's "example-drops-8-composer" package and set it up to manage using Composer (see https://pantheon.io/docs/guides/drupal-8-composer-no-ci).

Then, in a local copy of the git repo I created a separate branch to work in. I changed the "minimum-stability" settings in composer.json to "dev" in order to allow it to use CiviCRM. Then I ran the command from the instructions above to "composer require" the civicrm-drupal-8 package and followed the steps on https://gitlab.com/roundearth/drupal-civicrm-project#installing-civicrm to install and set up the "civicrm" module.

I ultimately got CiviCRM working on my local env in this new branch. I also ran "composer run-script --no-dev prepare-for-pantheon" to clean up the .git submodules in the project so it can be pushed to Pantheon.
The final step was to merge the branch back into 'master' in order to push the whole thing to Pantheon. The merge ran successfully. However, when trying to enable the civicrm module in the environment with the master branch I found that all of the civicrm modules are missing. So, I ran "composer update" to try to apply the composer.json, which has the civicrm-drupal-8 package in it's requirements.

Composer update ran and indicated there was nothing to update or install and then threw this RunTimException:
Could not scan for classes inside "/Applications/MAMP/htdocs/ctz_civicrm/releases/ctzcount/vendor/zetacomponents/mail/src" which does
not appear to be a file nor a folder

The "/vendor/zetacomponents/mail" directory is there, but it is empty.

THEORY: Is it possible that running the "prepare-for-pantheon" script to remove the .git submodules caused this problem? I know that there was a .git directory in the zetacomponents directory before. Perhaps it requires that for "composer update" to work correctly and pull the required package?

Any help that anyone can provide would be very much appreciated. Thanks!

What I suspect happened is you did a 'git add' and 'git commit' on the folders that had .git files in them BEFORE running the 'prepare-for-pantheon' script, which got those directories registered as submodules with Git. I forget the exact process for telling Git that a directory isn't a submodule, but I think you're going to need to do that on each of the affected directories, then 'git add' the actual code, and commit and push again.

Excellent thought, thank you David! I'll check my command-line history and see what order I did those steps in. If necessary I can do it again from scratch and be careful to run the 'prepare-for-pantheon' script before committing the new files to Git.
Thanks again! ~ Kevin

I've had to apply the following code update directly in order to get the CiviCRM app running.

https://github.com/civicrm/civicrm-core/pull/14696/commits/e7e176259f89a...

Is there something that can be done so the PR that was merged recently is pulled into the build using the instructions you've so graciously outlined and the Composer helper that you've provided? This was really helpful except having to figure out this issue.

Using Composer for CiviCRM means you end up with eg

/home/{accountname}/{foldernameIchoose}/web

folder structure. How can you use this with cPanel which requires

/home/{accountname}/public_html

There's a couple options.

I've heard people say the made a symlink from the directory name they need to web. So, in your case a symlink from public_html to web.

However, it'd be really nice for this to be configurable! There is an issue about it in the GitLab project:

https://gitlab.com/roundearth/civicrm-composer-plugin/issues/1

I think the idea about looking at the 'installer-paths' seems best. That way, you'd just change the top-level composer.json to put stuff under 'public_html' and the CiviCRM composer plugin would follow suite.

Drush executes if you are in the parent directory to web (it finds the 'drush' folder at the same level as 'web'). However 'drush status' doesn't return any information about the website eg Drupal version etc?
I presume this is because it hasn't found the settings.php file?
Also if you try eg 'drush en' you get:
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command. [error]
The drush command 'en' could not be executed.

Yeah, if you're running Drush from the parent directory, you need to do like 'drush -r web status' to tell it where the Drupal root is. You can also do this with Drush aliases.

If I run 'drush -r web status' from the folder above 'web' I get:

PHP Fatal error: Class 'Drush\Commands\DrushCommands' not found in C:\Users\{username}\Sites\devdesktop\d8\drush\Commands\PolicyCommands.php on line 10

Fatal error: Class 'Drush\Commands\DrushCommands' not found in C:\Users\{username}\Sites\devdesktop\d8\drush\Commands\PolicyCommands.php on line 10
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Class 'Drush\Commands\DrushCommands' not found in C:\Users\{username}\Sites\devdesktop\d8\drush\Commands\PolicyCommands.php, line 10

Have I got a %PATH% issue?

Hm. Not sure! However, it's not related to CiviCRM, so you'll probably have better luck looking for help for Drupal 8 and DevDesktop on Windows or something like that.

Hi
I'm working on Linux cpanels now.
Did composer create-project roundearth/drupal-civicrm-project:8.x-dev gmhiveorguk --no-interaction which looks as though it completed without errors.
At the point I try to do (1 level up from 'web')
drush en -y civicrm
I get
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command. [error]
The drush command 'en civicrm' could not be executed. [error]
A Drupal installation directory could not be found.

Drush status gives

drush status
PHP executable : /usr/bin/php-cli
PHP configuration : /opt/cpanel/ea-php71/root/etc/php.ini
PHP OS : Linux
Drush version : 6.0-dev
Drush configuration :
Drush alias files :

I'm assuming you went through the Drupal 8 installer and had a functional Drupal 8 site first?

Then you'll need to either be in the 'web' directory, or run 'drush -r web en -y civicrm' or use a Drush alias or something.

However, that's all normal Drupal 8 stuff, and it might be easier/quicker for you to look for help out in the general Drupalsphere rather than here. :-)

After running
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction
I found that the drush version was rather old?
I'm wondering if this is connected with Drush issues I have reported?
Surely it should be version 8 or 9 with D8.8.7?

drush --version
Drush Version : 6.0-dev

The project template doesn't include Drush - that Drush must be the one installed on your system. If you want to add Drush to the site, you can do that with 'composer require drush/drush'

Just did the drush install (see below) but I still have
drush --version
Drush Version : 6.0-dev

If it doesn't install Drush, where does web/vendor/drush come from?
thanks Mike
*******************************************
composer require drush/drush
No composer.json in current directory, do you want to use the one at /home/gmhiveorg/gmhiveorguk? [Y,n]? n
Using version ^9.7 for drush/drush
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 39 installs, 0 updates, 0 removals
- Installing symfony/polyfill-ctype (v1.12.0): Loading from cache
- Installing webmozart/assert (1.5.0): Loading from cache
- Installing webmozart/path-util (2.3.0): Loading from cache
- Installing webflo/drupal-finder (1.2.0): Loading from cache
- Installing symfony/yaml (v3.4.31): Loading from cache
- Installing symfony/polyfill-php72 (v1.12.0): Loading from cache
- Installing symfony/polyfill-mbstring (v1.12.0): Loading from cache
- Installing symfony/var-dumper (v4.3.4): Loading from cache
- Installing symfony/process (v3.4.31): Loading from cache
- Installing symfony/finder (v4.3.4): Downloading (100%)
- Installing symfony/event-dispatcher (v3.4.31): Loading from cache
- Installing psr/log (1.1.0): Loading from cache
- Installing symfony/debug (v4.3.4): Downloading (100%)
- Installing symfony/console (v3.4.31): Loading from cache
- Installing jakub-onderka/php-console-color (v0.2): Loading from cache
- Installing jakub-onderka/php-console-highlighter (v0.4): Loading from cache
- Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache
- Installing nikic/php-parser (v4.2.4): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing psy/psysh (v0.9.9): Loading from cache
- Installing container-interop/container-interop (1.2.0): Loading from cache
- Installing league/container (2.4.1): Loading from cache
- Installing dflydev/dot-access-data (v1.1.0): Loading from cache
- Installing grasmash/yaml-expander (1.4.0): Loading from cache
- Installing grasmash/expander (1.0.0): Loading from cache
- Installing consolidation/config (1.2.1): Loading from cache
- Installing consolidation/site-alias (3.0.0): Loading from cache
- Installing consolidation/site-process (2.1.0): Loading from cache
- Installing symfony/filesystem (v4.3.4): Downloading (100%)
- Installing consolidation/self-update (1.1.5): Loading from cache
- Installing consolidation/output-formatters (3.5.0): Loading from cache
- Installing consolidation/annotated-command (2.12.0): Loading from cache
- Installing consolidation/log (1.1.1): Loading from cache
- Installing consolidation/robo (1.4.10): Loading from cache
- Installing consolidation/filter-via-dot-access-data (1.0.0): Loading from cache
- Installing composer/semver (1.5.0): Loading from cache
- Installing twig/twig (v2.11.3): Downloading (100%)
- Installing chi-teck/drupal-code-generator (1.30.4): Loading from cache
- Installing drush/drush (9.7.1): Loading from cache
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/event-dispatcher suggests installing symfony/http-kernel
symfony/console suggests installing symfony/lock
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
consolidation/robo suggests installing pear/archive_tar (Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.)
consolidation/robo suggests installing henrikbjorn/lurker (For monitoring filesystem changes in taskWatch)
consolidation/robo suggests installing patchwork/jsqueeze (For minifying JS files in taskMinify)
consolidation/robo suggests installing natxet/CssMin (For minifying CSS files in taskMinify)
Writing lock file
Generating autoload files

Oh, sorry, I thought we didn't include Drush, because we didn't want to force users on to Drush 8 or 9, given that they are so different and not compatible with the same things. For example, the CiviCRM integration only works with Drush 8, but there are other modules with integration that only work with Drush 9. However, it looks like at some point that changed, and we actually have a requirement for Drush 9 in the composer.json now. I'm gonna need to think about that, and maybe reverse it, because it seems weird to require Drush 9 when the Civi commands won't work with it...

In any case, to your specific issues:

drush --version
Drush Version : 6.0-dev

That looks like your system Drush, not your site Drush. If you run 'vendor/bin/drush' it should show version 9.7.1, based on the composer output you put in your comment.

Hi David
Thanks for all your input on this. I have made some progress!
If you are in the {project} folder (above "web") then Drush commands are from system Drush (in my case version 6.0-dev).
However, from the same folder, you can run eg "vendor/bin/drush" which is a link file to {project}/drush/drush/drush) which gives you access to the local Drush version (9.7.1).
Critically you can run "vendor/bin/drush en -y civicrm" which then knows all about the local Drupal site, and installs the CiviCRM module.
Thanks again - Hopefully this thread will help others.

Hi David
I have got a problem setting up scheduled jobs cron with D8.
Cron job is:
/usr/local/bin/ea-php72 /home/<accountname>/<foldername>/vendor/civicrm/civicrm-core/bin/cli.php -s <domain> -u admin -p <password> -e Job -a execute
but get an error:
Could not load the settings file at: /home/<accountname>/<foldername>/vendor/civicrm/civicrm-core/../../../../default/civicrm.settings.php

Is there another way to configure scheduled jobs with CiviCRM + D8?
Thanks Mike

I've never tried cli.php - it could very well be broken with Drupal 8. However, using drush should work, so something like:

drush @example.org -u admin cvapi Job.execute

Hi David

I've tried the drush method:

/home/<username>/<foldername>/vendor/bin/drush -r /home/<username>/<foldername>/web -l <domainname> -u admin civicrm-api Job.execute

but that gives me

Command "admin" is not defined.

What version of Drush are you using? The Drush commands in the 'civicrm' module only work for Drush 8, and not Drush 9.

But that's my only good guess. We use 'drush cvapi' for loads of stuff and it works fine. The only real difference I see in how you're using it, is that we generally use Drush aliases rather than specifying the Drupal root and domain on the command-line.

CV is the way to go. I've successfully used a command like:

/usr/local/bin/ea-php72 /usr/local/bin/cv api job.execute --user=admin --cwd=/home/<username>/<foldername>/web

Ok, great! I'm not sure why Drush isn't working for you, but I'm glad something is :-)

How do you upgrade CiviCRM if installed via
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction ?
Can you do the same as D7 ?

Not the same as D7, you'd have to update the code via composer, so like you'd update anything on a composer-ized D8 site.

For example, something like:

composer update civicrm/civicrm-core civicrm/civicrm-drupal-8 --with-dependencies

And then you'd have to do the CiviCRM-specific steps, like update the database:

drush cvupdb

But the exact process could vary depending on what all stuff you have installed, of course.

Hi David I updated Drupal core ok but Civi update has broken the site.

Any ideas? Thanks Mike

composer update civicrm/civicrm-core civicrm/civicrm-drupal-8 --with-dependencies
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Dependency "cweagans/composer-patches" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "composer/installers" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 3 updates, 0 removals
- Installing togos/gitignore (1.1.1): Downloading (100%)
- Installing civicrm/composer-downloads-plugin (v2.1.1): Downloading (100%)
- Updating league/csv (9.3.0 => 9.4.1): Downloading (100%)
- Updating civicrm/civicrm-core (5.17.4 => 5.18.4): Downloading (100%)
Download extra files for civicrm/civicrm-core
- Installing civicrm/civicrm-core:angular (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-bootstrap (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-file-upload (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-jquery-dialog-service (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-mocks (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-route (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-sanitize (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-ui-sortable (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-ui-utils (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-unsavedchanges (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:angular-xeditable (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:checklist-model (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:ckeditor (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:crossfilter-1.3.x (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:crossfilter2 (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:css-color-names (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:d3 (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:d3-3.5.x (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:datatables (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:dc-2.1.x (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:es6-promise (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:font-awesome (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:google-code-prettify (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:jquery (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:jquery-ui (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:jquery-validation (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:jstree (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:lodash-compat (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:phantomjs-polyfill (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:qunit (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:select2 (5.18.4): Downloading (100%)
- Installing civicrm/civicrm-core:smartmenus (5.18.4): Downloading (100%)
> [civicrm-composer-plugin] Running bower for CiviCRM...

[Symfony\Component\Process\Exception\ProcessFailedException]
The command "bower install" failed.

Exit Code: 1(General error)

Working directory: /home/gmhiveorg/gmhiveorguk/vendor/civicrm/civicrm-core

Output:
================

Error Output:
================
bower ENOENT No bower.json present

Ah, you need to update the plugin as well! Totten contributed a change that allows it to work with the latest CiviCRM, which changes how it get gets Javascript dependencies. So, you probably need to run something like:

composer update roundearth/civicrm-composer-plugin civicrm/civicrm-core civicrm/civicrm-drupal-8 --with-dependencies

Hi,

Hope you can help. I am busy setting up the civismtp settings on https://www.civismtp.com/

I have a real problem pointing to the SOAP file inside https://www.sitename.org/vendor/civicrm/civicrm-core/extern/soap.php

I keep on getting:
Civimail User Check : it appears that the proxy URL that you gave is invalid

Browsing to the file also gives me the following error:
Could not find valid configuration dir, best guess: /usr/www/users/username/vendor/civicrm/civicrm-core/../../../..

Seems that it has a hard time getting to the file inside the vendor folder?

The vendor generally directory isn't web-accessible (for security reasons) which is why the CiviCRM plugin sync's all the web-accessible stuff to /libraries/civicrm. So, you want to actually point to:

https://www.sitename.org/libraries/civicrm/extern/soap.php

Hi David, thanks for the feedback here. I can see the soap file in the libraries folder: https://www.mywebsite.com/web/libraries/civicrm/extern/soap.php as pointed out. I have changed the value in the CiviCRM SMTP configuration, but i still get the same error. When you say sync, does this happen once when you install Civi, or does it happen on a scheduled job or cron run as well?

Following the debug script, I am not sure if this is a permission error, or if Civi even syncs from the vendor folder to the libraries folder... Running the check_soap.php I get what looks like permission errors on the user created.

I have uploaded the soap_check.php file in my installation web folder, passing the required parameters gives me the following error: SoapFault exception: [HTTP] Forbidden in /usr/www/users/mywebsite/web/check_soap.php:13 Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://www.mywebsite...', 'http://test-uri...', 1, 0)
#1 /usr/www/users/mywebsite/web/check_soap.php(13): SoapClient->__call('authenticate', Array)
#2 {main} Raw Response:

Passing the main admin account details instead of the new user gives me the following error: SoapFault exception: [HTTP] Unable to parse URL in /usr/www/users/mywebsite/web/check_soap.php:13 Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'check_soap.php', 'http://test-uri...', 1, 0)
#1 /usr/www/users/mywebsite/web/check_soap.php(13): SoapClient->__call('authenticate', Array)
#2 {main} Raw Response:

I have set all folder permissions to 755, so pretty sure its not a permission issue. Any feedback would be greatly appreciated here... In drupal 7 you pointed to the modules file, and that works... quite stumped here...

When you say sync, does this happen once when you install Civi, or does it happen on a scheduled job or cron run as well?

It's done by the composer plugin that this article is about. It'll only happen automatically when you install or update CiviCRM via composer, but you can trigger it yourself via 'composer civicrm:sync-web-assets'

As for your issues with soap.php, I'm really not sure: I've never used that script before. It's possible it needs some changes/fixes in order to work with Drupal 8, as there were other scripts in 'extern' that needed minor changes. Looking in the soap.php, there isn't much there, but I wonder if the 'civicrm.config.php' it's looking for might be missing?

See https://github.com/civicrm/civicrm-core/blob/master/extern/soap.php#L17

I can confirm that the civicrm.config.php file is in both the vendor and libraries parent directories. I can also confirm that the files are identical, so not sure if its a syncing issue...

Upon further digging, I looked that you have 2 .htaccess files.

For testing purposes, I disabled it completely and attempted to run the script. The following error returned:

[email protected]:~/public_html/web$ php check_soap.php <user> <pass> https://www.mysite/web/libraries/civicrm/extern/soap.php
SoapFault exception: [Client] looks like we got no XML document in /usr/www/users/mysite/web/check_soap.php:13
Stack trace:
#0 /usr/www/users/mysite/web/check_soap.php(13): SoapClient->__call('authenticate', Array)
#1 {main}
Raw Response:
Fatal error: Uncaught Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in /usr/www/users/mysite/web/core/lib/Drupal.php:130
Stack trace:
#0 /usr/www/users/mysite/web/core/lib/Drupal.php(639): Drupal::getContainer()
#1 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Utils/System/Drupal8.php(664): Drupal::languageManager()
#2 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Utils/System/DrupalBase.php(442): CRM_Utils_System_Drupal8->getCurrentLanguage()
#3 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Utils/System.php(74): CRM_Utils_System_DrupalBase->getUFLocale()
#4 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Core/BAO/ConfigSetting.php(203): CRM_Utils_System::__callStatic('getUFLocale', Array)
#5 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Core/Config.php(116): CRM_Core_BAO_ConfigSetting::applyLocale(Object(Civi\Core\SettingsBag), NULL)
#6 /usr/www/users/s in /usr/www/users/mysite/web/core/lib/Drupal.php on line 130

​We then added the standard Drupal .htaccess file and ran the script again. Please see below output:

[email protected]:~/public_html/web$ php check_soap.php <user> <pass> https://www.mysite.org.za/web/libraries/civicrm/extern/soap.php
SoapFault exception: [HTTP] Internal Server Error in /usr/www/users/mysite/web/check_soap.php:13
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://www.sao...', 'http://test-uri...', 1, 0)
#1 /usr/www/users/mysite/web/check_soap.php(13): SoapClient->__call('authenticate', Array)
#2 {main}
Raw Response:

Although there was still an error generated, the message differs from when you run the script with the current .htaccess file (Internal Server Error as opposed to Forbidden).

The above result could be an indication that the script cannot be run due to coding in your our installation which is blocking it?

Hi David,

Still fighting this. I am making progress I recon though. I added some direct paths to my .htaccess to allow permissions to the soap.php file in the libraries folder. I have also hardcoded the path values in the civicrm.config file, line 116. I also came across another post https://colorfield.be/blog/install-civicrm-5-with-drupal-8-using-lando. I added the .htaccess file as suggested in their Allow CiviCRM to access the extern directory section.

My error when running the soap_check file now returns:
SoapFault exception: [Client] looks like we got no XML document in /usr/www/users/mysite/web/check_soap.php:13
Stack trace:
#0 /usr/www/users/mysite/web/check_soap.php(13): SoapClient->__call('authenticate', Array)
#1 {main}
Raw Response:

Fatal error: Uncaught Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in /usr/www/users/mysite/web/core/lib/Drupal.php:130
Stack trace:
#0 /usr/www/users/mysite/web/core/lib/Drupal.php(639): Drupal::getContainer()
#1 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Utils/System/Drupal8.php(664): Drupal::languageManager()
#2 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Utils/System/DrupalBase.php(442): CRM_Utils_System_Drupal8->getCurrentLanguage()
#3 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Utils/System.php(74): CRM_Utils_System_DrupalBase->getUFLocale()
#4 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Core/BAO/ConfigSetting.php(203): CRM_Utils_System::__callStatic('getUFLocale', Array)
#5 /usr/www/users/mysite/vendor/civicrm/civicrm-core/CRM/Core/Config.php(116): CRM_Core_BAO_ConfigSetting::applyLocale(Object(Civi\Core\SettingsBag), NULL)
#6 /usr/www/users/s in /usr/www/users/mysite/web/core/lib/Drupal.php on line 130

Hi David

Trying to update Drupal core to version 8.8.1 (security concerns). https://www.drupal.org/sa-core-2019-012

Tried
composer update drupal/core --with-dependencies
drush updatedb
drush cache:rebuild

but admin/reports/status reports that the version is still on 8.8.0.

Any ideas?

regards Mike

Not CiviCRM-related, but you could be held back by other constraints. One of the most common 'webflo/drupal-core-require-dev' so you could try doing:

composer update drupal/core webflo/drupal-core-require-dev --with-dependencies

If that doesn't work, you can do 'composer require drupal/core:8.8.1' which will pin you specifically to 8.8.1, which isn't ideal (you can switch it back after), but it'll definitely tell you why it can't update to 8.8.1. It could be some other dependency you have that requires something that wouldn't be if the 8.8.1 update went through.

Does https://packagist.org/packages/roundearth/drupal-civicrm-project need to be updated? That references drupal/core: ^8.6.0 not 8.8.1 ?

Add comment

o