3

Having installed a site with the latest versions of Drupal8 and CiviCRM, I connected it to a shared CiviCRM database.

  1. I followed the "full manual process" of David Snopek to successfully install Drupal 8.6.4 & CiviCRM 5.8.2 !
  2. Then I used the advices of Jon G. on how to separate the Drupal 8 database from my CiviCRM database.

These were great positive steps but very fast, I run into issues concerning the Navigation and several Extensions.

Concerning the Navigation issue the menu items are shown in a wrong alignement and they are not clicable.

Navigation issue with Civi5.8.2 & Drupal8

The Shoreditch extension is ON but it could not not seen in the CiviCRM settings for the Resource URLs (civicrm/admin/setting/url?reset=1). I manually did set the path.

On one page there is a missing image with this warning : "civicrm Forbidden You don't have permission to access /vendor/civicrm/civicrm-core/i/Inform.gif on this server." Can this be a clue ?

Concerning the Extensions, most of them works fine, like on the Drupal7 sites sharing the same CiviCRM 5.8.2 database. The most troublesome extension is the API v4(org.civicrm.api4) that handle the Contact Layout Editor (org.civicrm.contactlayout). This extension break the CiviCRM site : The website encountered an unexpected error. Please try again later. The Drupal8 is still OK and gave this error message :

Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: Unable to parse file "PATH/sites/default/files/civicrm/ext/org.civicrm.api4/services.xml". in Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM() (line 386 of PATH/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php).

Another point is there no Views integration settings in the Settings - Drupal Integration

enter image description here

Thanks for any help ;-)


EDIT (pasted from comment)

Thank you very much Jon,

This clarify the question about the position of the vendor file. Your point of view make great sense. It seems to be a more clean organisation and for the security reasons that you mentioned also, I do agree.

So I will then withdraw from this direction where vendor was webroot-accessible to go forward with symlinking the vendor directory into the webroot. But when I follow the process, and at the very beginning of your Drupal 8/CiviCRM notes, with the Civi 5.8.2 there is an Error : our requirements could not be resolved to an installable set of packages. I do not recall this error when I use the (a) method (vendor in the webroot).

But when I follow the process, and at the very beginning of your Drupal 8/CiviCRM notes, with the Civi 5.8.2 there is an Error : our requirements could not be resolved to an installable set of packages. I do not recall this error when I use the (a) method (vendor in the webroot).

But when I follow the process, and at the very beginning of your Drupal 8/CiviCRM notes, with the Civi 5.8.2 there is an Error : our requirements could not be resolved to an installable set of packages. I do not recall this error when I use the (a) method (vendor in the webroot).

   Problem 1
    - civicrm/civicrm-core 5.8.2 requires civicrm/civicrm-cxn-rpc ~0.17.07.01 
-> satisfiable by civicrm/civicrm-cxn-rpc[v0.17.07.01].
    - Installation request for civicrm/civicrm-core 5.8.2 
-> satisfiable by civicrm/civicrm-core[5.8.2].
    - Conclusion: remove psr/log 1.1.0
    - Conclusion: don't install psr/log 1.1.0
    - civicrm/civicrm-cxn-rpc v0.17.07.01 requires psr/log ~1.0.0 
-> satisfiable by psr/log[1.0.0, 1.0.1, 1.0.2].
    - Can only install one of: psr/log[1.0.0, 1.1.0].
    - Can only install one of: psr/log[1.0.1, 1.1.0].
    - Can only install one of: psr/log[1.0.2, 1.1.0].
    - Installation request for psr/log (locked at 1.1.0) 
-> satisfiable by psr/log[1.1.0].
    Installation failed, reverting ./composer.json to its original content.

Is this a setting only that I can change in the json file of the Composer ? Can I change the composer repository to access to the Civi 9-beta ? In case, of course, that the Civi 9.0 handle civicrm/civicrm-cxn-rpc ~0.17.07.01. is handled now.


==> EDIT #2

After the several advices of Jon (Thanks a lot ;-) I could complete the install of CiviCRM 5.8.2 which is now OK with Drupal 8.6.4 !

  1. Install Drupal

composer create-project drupal-composer/drupal-project:8.x-dev --no-dev

  1. Follow Jon G. CiviCRM for Drupal 8 installation notes
  2. If the Installation failed (at the initial stage following the David Snopek instructions) with the version psr/log 1.1.0 being too new for CiviCRM, then force with Composer to an earlier version =>

composer require psr/log 1.0.0

  1. After that restart and complete the Installation
  2. After adding the recommended lines to civicrm.settings.php, CiviCRM works with the right menu ;-)
  3. Now the difficult part : connect to the external CiviCRM database. After disabling a few extensions I could make all the system work ! After the few extensions discussed with Jon ( Shoreditch, APIv4 & Contact Layout Editor because it depends on this one) I noticed another trouble with the General Data Protection Regulation extension by (uk.co.vedaconsulting.gdpr). The contact page was white. After disabling the GDPR extension, CiviCRM is now connected to the external database ;-)

Thank you so much David Snopek for your work and Jon G. for your great help !

0

2 Answers 2

2

There are multiple conflicting methods of installing CiviCRM with Drupal 8. It sounds like you're either a) placing the vendor directory into your webroot, or b) symlinking the vendor directory into your webroot.

The lack of definitive instructions for D8/Civi is frustrating. However (for security reasons) I believe the community won't accept a solution where vendor is webroot-accessible, which the "dsnopek full manual process" does. Note that David Snopek does NOT use that approach himself anymore!

Here are my Drupal 8/CiviCRM notes. Instead of installing vendor in webroot, I copy the JS/CSS/etc. resources only into a web-accessible directory. Pay particular attention to the last bullet point; manually setting paths in civicrm.settings.php is almost certainly the solution here for Shoreditch.

Also note Shoreditch has another problem in D8 that breaks QuickSearch, but it's fixed in Civi 5.9+. You can backport the fix to 5.8 or upgrade to 5.9 next week (January 2nd 2019).

As for APIv4, there's a breaking incompatibility between the Symfony version it wants and Drupal 8. Contact Layout Editor is off the table until that's fixed. This requires that CiviCRM be upgraded to Symfony 3+.

6
  • @Ichi If you join the ~Drupal channel on chat.civicrm.org, there's a "Drupal 8 to the finish line" sprint being planned for February or March by Olly Gibson. Commented Dec 27, 2018 at 19:41
  • Yes Jon, I will join the channel. If I can help, that will be w/ pleasure.
    – Ichi
    Commented Dec 28, 2018 at 7:27
  • @Ichi Great! Find me on chat as "junglebird". Note that I am NOT suggesting you symlink your vendor directory into the web directory - this is as insecure as installing vendor there directly. Instead, install vendor alongside your web directory (this is the default). Then, per my instructions, create a directory libraries/civicrm under the web directory, and copy all assets (JS/CSS/etc.) there. Commented Dec 28, 2018 at 23:30
  • Thanks Jon and Ichi - this question and answer helped me wade through all the info out there. I've also made my own notes at gist.github.com/demeritcowboy/89cab9859c5db2e767fa0e1f5630214b
    – Demerit
    Commented Dec 30, 2018 at 16:05
  • Glad to hear it @Demerit! I have a backlog of documentation tasks, but I have it in mind to try to write the new definitive D8 install guide and put it in the docs. Commented Dec 30, 2018 at 21:22
1

With regard to the issue posted in your update: There's a dependency conflict between CiviCRM and some other component you have installed over which version of psr/log should be installed.

Both civicrm-core and civicrm-cxn-rpc specify psr/log ~1.0.0 which means "any version starting with 1.0". You have another package that's specifying psr/log 1.1.0. I couldn't tell you which one, though you could probably figure it out by searching your composer.lock file.

psr/log 1.1.0 is pretty new - about 5 weeks old. I just opened an issue for CiviCRM to support it. My guess is that it works just fine, it just needs the composer.json updated.

There's probably a way to tell composer to accept the newer psr/log but I don't know it. Hopefully someone else will chime in with the quick workaround!

2
  • Thanks Jon, yes the psr/log 1.1.0 version comes with Drupal 8.6.4 unfortunately . This is so hard to make CiviCRM work with Drupal ;-( I am not used to Composer but I am getting better. I use the command : "composer require psr/log 1.0.0" to be able to finish the CiviCRM installation without trouble.
    – Ichi
    Commented Dec 29, 2018 at 16:01
  • Agreed @Ichi! However, of the many problems that CiviCRM/D8 installation have, I think this one is a little more forgivable. CiviCRM releases monthly, and Drupal 8.6.4 changed the psr/log minimum after the Drupal 5.8 release. Drupal 8.6.3 doesn't have this issue. But thanks to your pointing this out, we've already got patches in the review pipeline: github.com/civicrm/civicrm-cxn-rpc/pull/8 Commented Dec 29, 2018 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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