Drupal issueshttps://lab.civicrm.org/dev/drupal/-/issues2020-09-14T03:22:22Zhttps://lab.civicrm.org/dev/drupal/-/issues/129When creating a D8 private file system e.g. /sites/default/private -> CiviCRM...2020-09-14T03:22:22ZKarinGWhen creating a D8 private file system e.g. /sites/default/private -> CiviCRM overrides location for templates_c specified in civicrm.settings.php fileIs this intentional? And is it necessary? I first saw this on my Pantheon test install and am now seeing it on one of Alan's hosted sites as well. Storing `templates_c` in the private file system [even though the `civicrm.settings.php` f...Is this intentional? And is it necessary? I first saw this on my Pantheon test install and am now seeing it on one of Alan's hosted sites as well. Storing `templates_c` in the private file system [even though the `civicrm.settings.php` file still has the non-public files location] results in a slow page load.
This only happens if you put your private files dir in `/sites/default/ `
On Alan's hosting we can move the private/files to the same level as `web/`
`[$settings['file_private_path'] = $app_root . '/../private/files';`
- so CiviCRM keeps using `/sites/default/files` for `templates_c` - but on Pantheon [and likely other hosting] you may not have access to create a dir at that level.
End result is that it creates the impression that CiviCRM on D8 is very slow.
@DaveD @seamuslee @jackrabbithanna @bgm - any ideas as to why/history/intentional?https://lab.civicrm.org/dev/drupal/-/issues/128CiviCRM menu disappears immediately after clicking the CiviCRM button.2020-07-26T19:46:09ZHeneryHCiviCRM menu disappears immediately after clicking the CiviCRM button.![Screen_Shot_2020-07-10_at_7.53.31_PM](/uploads/f352a63527756f273cb26cacaf41752e/Screen_Shot_2020-07-10_at_7.53.31_PM.png)
Here is a log of the errors in my browser when the event happens
```
The resource from “http://bionic.mydomain....![Screen_Shot_2020-07-10_at_7.53.31_PM](/uploads/f352a63527756f273cb26cacaf41752e/Screen_Shot_2020-07-10_at_7.53.31_PM.png)
Here is a log of the errors in my browser when the event happens
```
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-ui/jquery-ui.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.timeentry.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/select2/select2.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery/dist/jquery.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery/dist/jquery.min.js”. civicrm:9:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.form.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/lodash-compat/lodash.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.blockUI.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/datatables/media/js/jquery.dataTables.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-validation/dist/additional-methods.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-validation/dist/jquery.validate.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/Common.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.datepicker.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.ajax.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.notify.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/wysiwyg/crm.wysiwyg.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.tableHeader.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/smartmenus/dist/jquery.smartmenus.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/smartmenus/dist/addons/keyboard/jquery.smartmenus.keyboard.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/jquery/jquery.dashboard.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.menubar.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.optionEdit.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/noconflict.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.drupal8.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/css/crm-i.css?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/datatables/media/css/jquery.dataTables.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/font-awesome/css/font-awesome.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/css/civicrm.css?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/select2/select2.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/d3/d3.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/crossfilter2/crossfilter.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/dc-2.1.x/dc.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/css/dashboard.css?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-ui/jquery-ui.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-ui/jquery-ui.min.js”. civicrm:11:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/lodash-compat/lodash.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/lodash-compat/lodash.min.js”. civicrm:13:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js”. civicrm:15:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/select2/select2.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/select2/select2.min.js”. civicrm:17:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.form.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.form.min.js”. civicrm:19:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.timeentry.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.timeentry.min.js”. civicrm:21:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.blockUI.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.blockUI.min.js”. civicrm:23:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/datatables/media/js/jquery.dataTables.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/datatables/media/js/jquery.dataTables.min.js”. civicrm:25:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-validation/dist/jquery.validate.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-validation/dist/jquery.validate.min.js”. civicrm:27:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-validation/dist/additional-methods.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-validation/dist/additional-methods.min.js”. civicrm:29:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.min.js”. civicrm:31:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/Common.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/Common.js?r=vESOV”. civicrm:33:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.datepicker.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.datepicker.js?r=vESOV”. civicrm:35:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.ajax.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.ajax.js?r=vESOV”. civicrm:37:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/wysiwyg/crm.wysiwyg.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/wysiwyg/crm.wysiwyg.js?r=vESOV”. civicrm:39:1
Uncaught ReferenceError: jQuery is not defined
<anonymous> http://bionic.mydomain.org/civicrm/ajax/l10n-js/en_US?cid=2&r=vESOV:114
en_US:114:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.tableHeader.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.tableHeader.js”. civicrm:43:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.notify.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/packages/jquery/plugins/jquery.notify.min.js”. civicrm:45:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/smartmenus/dist/jquery.smartmenus.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/smartmenus/dist/jquery.smartmenus.min.js”. civicrm:47:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/smartmenus/dist/addons/keyboard/jquery.smartmenus.keyboard.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/smartmenus/dist/addons/keyboard/jquery.smartmenus.keyboard.min.js”. civicrm:49:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.menubar.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.menubar.js?r=vESOV”. civicrm:51:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.optionEdit.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.optionEdit.js?r=vESOV”. civicrm:53:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.drupal8.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/crm.drupal8.js?r=vESOV”. civicrm:55:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/jquery/jquery.dashboard.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/jquery/jquery.dashboard.js?r=vESOV”. civicrm:57:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/js/noconflict.js?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core/js/noconflict.js?r=vESOV”. civicrm:59:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/datatables/media/css/jquery.dataTables.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/css/civicrm.css?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/css/crm-i.css?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/font-awesome/css/font-awesome.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/select2/select2.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. modernizr.min.js:3:3631
Uncaught TypeError: CRM.$ is not a function
<anonymous> http://bionic.mydomain.org/civicrm:232
civicrm:232:5
The resource from “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/d3/d3.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/d3/d3.min.js”. civicrm:304:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/crossfilter2/crossfilter.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/crossfilter2/crossfilter.min.js”. civicrm:305:1
The resource from “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/dc-2.1.x/dc.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
Loading failed for the <script> with source “http://bionic.mydomain.org/libraries/civicrm/core//bower_components/dc-2.1.x/dc.min.js”. civicrm:306:1
Uncaught TypeError: CRM.$ is not a function
<anonymous> http://bionic.mydomain.org/civicrm:473
civicrm:473:7
The resource from “http://bionic.mydomain.org/libraries/civicrm/core/css/dashboard.css?r=vESOV” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
civicrm
```
https://lab.civicrm.org/dev/drupal/-/issues/125Cron url not found and other cron challenges2021-10-01T15:48:59ZHeneryHCron url not found and other cron challengesI just installed CiviCRM 5.29.alpha (dev-master) on top of Drupal 8.9.2 and it seems to have worked for the most part.
I'm having some trouble with the cron jobs. Trying all different flavors with little success.
In my instance, this ...I just installed CiviCRM 5.29.alpha (dev-master) on top of Drupal 8.9.2 and it seems to have worked for the most part.
I'm having some trouble with the cron jobs. Trying all different flavors with little success.
In my instance, this URL is not found
http://my.domain.org/sites/all/modules/civicrm/bin/cron.php
I searched for the php file and it is here.
`<cms-root>/vendor/civicrm/civicrm-core/bin/cron.php`
Any hints on getting this URL method to work?
On another method...
When I run this command line, it seems to work but my cron table in CiviCRM never shows an updated execution event.
```
<cms-root>$ sudo -u www-data cv api job.version_check --user=admin --cwd=/var/www/drupal/web
{
"is_error": 0,
"version": 3,
"count": 1,
"values": 1
}
```
yet the table sever updates...
![Screen_Shot_2020-07-13_at_12.08.12_PM](/uploads/b7eddaeb0bcc02ed011603173503314c/Screen_Shot_2020-07-13_at_12.08.12_PM.png)https://lab.civicrm.org/dev/drupal/-/issues/115Let's make some D8 upgrade documentation2020-10-20T21:12:09ZStoobLet's make some D8 upgrade documentation[This single stack exchange](https://civicrm.stackexchange.com/questions/33945/how-can-i-update-civicrm-installed-with-drupal-8-using-composer) the best documentation yet I've found about upgrading Drupal 8 and it is varied and cluttered...[This single stack exchange](https://civicrm.stackexchange.com/questions/33945/how-can-i-update-civicrm-installed-with-drupal-8-using-composer) the best documentation yet I've found about upgrading Drupal 8 and it is varied and cluttered. With a security update of Civi planned for April, we need to provide a more consolidated way to provide upgrade instructions. I volunteer to help, but since I have not yet been successful upgrading my Composer-installed Civi on D8 (hosted by CiviHosting) myself I am not qualified to write it. I am currently looking for solutions and collaborators.2020-04-11https://lab.civicrm.org/dev/drupal/-/issues/112Installer requires anonymous users to have Administer site config permission ...2020-04-01T07:24:21ZherbdoolInstaller requires anonymous users to have Administer site config permission in order to installI'm installing CiviCRM 5.23.2 on Drupal 7 by going to `sites/all/modules/civicrm/install/`. It's a fresh Drupal 7 install on Lando. I get this message "The installer can only be run by a user with the permission to administer site config...I'm installing CiviCRM 5.23.2 on Drupal 7 by going to `sites/all/modules/civicrm/install/`. It's a fresh Drupal 7 install on Lando. I get this message "The installer can only be run by a user with the permission to administer site configuration." and it only allows me to install when I give anon users this permission. I am logged in as admin with all permissions enabled. So somehow the session is no longer active at the URL.https://lab.civicrm.org/dev/drupal/-/issues/111Multiple jquery errors after upgrading to Drupal 8.8.42020-03-22T15:24:38ZRob_SMultiple jquery errors after upgrading to Drupal 8.8.4I've applied the latest security patch to upgrade to Drupal 8.8.4 and it seems to have broken Civi. At /civicrm I am seeing no menu, the dashboards aren't loading and cannot be edited / updated. There are numerous js errors on the page w...I've applied the latest security patch to upgrade to Drupal 8.8.4 and it seems to have broken Civi. At /civicrm I am seeing no menu, the dashboards aren't loading and cannot be edited / updated. There are numerous js errors on the page which seem to stem from jquery being missing. THe first error is:
ReferenceError: jQuery is not defined /libraries/civicrm/js/Common.js:4:10
Any advice would be appreciated here people pleasehttps://lab.civicrm.org/dev/drupal/-/issues/109OG_Sync gives fatal error if User is Anonymous2020-03-16T07:37:34ZTony Maynard-SmithOG_Sync gives fatal error if User is AnonymousWhen creating or updating an Organic Group page, if the Author is set to Anonymous or left blank, the OG_Sync module throws a Fatal Error. This can be seen as line 224 of the civicrm_og_sync.module file in the attached backtrace.
Anonym...When creating or updating an Organic Group page, if the Author is set to Anonymous or left blank, the OG_Sync module throws a Fatal Error. This can be seen as line 224 of the civicrm_og_sync.module file in the attached backtrace.
Anonymous is a valid entry for Author on the Drupal form, and should not throw this error. We have a number of occurrences of this where the Group Page has been converted from a previous normal page not using OG, and the original Author had been deleted or otherwise set to Anonymous.
![OG_Sync_error](/uploads/d1c254caa0e18bb4370186657cf1c556/OG_Sync_error.png)https://lab.civicrm.org/dev/drupal/-/issues/104Drupal8 + Plesk: User path missing from cmsRootPath()2020-01-15T06:04:53ZRar9Drupal8 + Plesk: User path missing from cmsRootPath()The cmsRootPath() is not able to get absolute path, specifically the user folder portion of the path on Plesk.
This might be caused by multisite setup, function being insufficient or permission.
To fix CRON for plesk the following nee...The cmsRootPath() is not able to get absolute path, specifically the user folder portion of the path on Plesk.
This might be caused by multisite setup, function being insufficient or permission.
To fix CRON for plesk the following needs to be changed
vendor/civicrm/civicrm-core/CRM/Utils/System/Drupal8.php at line 441:
```diff
-return $civicrm_paths['cms.root']['path'];
+return realpath($_SERVER["DOCUMENT_ROOT"]) . '/'.array_slice(explode('/', $civicrm_paths['cms.root']['path']), -1)[0];
```
The cause is that in Plesk all files and directories under a domain document root directory should belong to psacln group and to the sysuser user. Where sysuser is a user of a corresponding subscription.
CIVICRM Cron only expects a chown -R www-data|psaserv .
The way to set correct permission is a correct way to fix the issue for subdomain.
This is described in the article above in step 3. https://support.plesk.com/hc/en-us/articles/115004094934https://lab.civicrm.org/dev/drupal/-/issues/101Error cancelling Drupal user2020-01-06T21:44:57ZedvanleeuwenError cancelling Drupal userWhen I cancel a Drupal user account, I get a non-descriptive error and cancellation has not been done. Doing this a second time does cancel the user, but the user relation is still visible in Civi because the entry in civicrm_uf_match is...When I cancel a Drupal user account, I get a non-descriptive error and cancellation has not been done. Doing this a second time does cancel the user, but the user relation is still visible in Civi because the entry in civicrm_uf_match is not removed.
Using Drupal 7.67 and CiviCRM 5.20.2.https://lab.civicrm.org/dev/drupal/-/issues/97Status report update for Drupal (similar to what was done for Backdrop)2020-01-29T14:53:02ZlarynStatus report update for Drupal (similar to what was done for Backdrop)I wrote a PR for Backdrop some time back and have been meaning to check if it would be desired for Drupal 7 as well -- if so I would be happy to base a MR here off of what I did there. Here's a visual of how it looks in Backdrop's Status...I wrote a PR for Backdrop some time back and have been meaning to check if it would be desired for Drupal 7 as well -- if so I would be happy to base a MR here off of what I did there. Here's a visual of how it looks in Backdrop's Status Report page (Drupal 7 status report would obviously look a little different):
![Screen_Shot_2019-12-04_at_7.10.28_PM](/uploads/0a83d103f2aec9652797d3ce71c41345/Screen_Shot_2019-12-04_at_7.10.28_PM.jpg)
Would a version of this for Drupal 7 be accepted?https://lab.civicrm.org/dev/drupal/-/issues/92Drupal8 - Solarium/Solarium 5.13 breaks Civicrm2020-10-24T21:12:08ZRar9Drupal8 - Solarium/Solarium 5.13 breaks CivicrmIf Solarium/Solarium 5.13 is used all Drupal 8 breaks
I was forced to apply composer require symfony/event-dispatcher:"4.3.4 as 3.4.99"
But this gives
PHP Fatal error: Uncaught Error: Class 'Symfony\Component\EventDispatcher\Contai...If Solarium/Solarium 5.13 is used all Drupal 8 breaks
I was forced to apply composer require symfony/event-dispatcher:"4.3.4 as 3.4.99"
But this gives
PHP Fatal error: Uncaught Error: Class 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher' not found in /var/www/vhosts/XXX/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php:18
![image](/uploads/cfcf9db6c5faf6acecd610b4b2933197/image.png)
If civicrm is disabled site works again.https://lab.civicrm.org/dev/drupal/-/issues/88CRM/Utils/System/Drupal8.php autoload.php path issue 5.16.32020-04-22T14:54:19ZndavisCRM/Utils/System/Drupal8.php autoload.php path issue 5.16.3line 419.
Relies on cmsRootPath
Standard drupal installation cms path (cmsRoot) is now [drupal root]/web.
Drupal8.php now looks for autoload as **[cms.root]//autoload.php** (line 419)
Unless you symlink autoload.php from ../vendor/au...line 419.
Relies on cmsRootPath
Standard drupal installation cms path (cmsRoot) is now [drupal root]/web.
Drupal8.php now looks for autoload as **[cms.root]//autoload.php** (line 419)
Unless you symlink autoload.php from ../vendor/autoload.php this fails to find autoload.php.
Suggest an if block that first tries `require_once "autoload.php";` and if that fails (vendor directory is not in php's include_path) *then* look for it in a better place than cmsRoot. As well [cms.root] has a trailing slash so the forward slash in the `$autoloader = require_once $root."/autoload.php"` is unnecessary.
vendor is not supposed to be accessible in the web root, so for anyone who's vendor directory is not the web root, and is in a directory one directory level up (out of web root) Drupal8.php won't find autoload.php.
I'm not sure of the Drupal8.php's history, but changes related to the path to autoload.php between 5.15.1 and 5.16.3 and broke things.
If you change the [cms.root] so Drupal8.php can find autoload.php the rest of civi breaks. If I set this path properly in Drupal8.php everything works.https://lab.civicrm.org/dev/drupal/-/issues/86Group Role sync not mapping users but duplicating users2019-09-13T07:05:05ZacaselliGroup Role sync not mapping users but duplicating usersHi,
The group role sync module doesn't seem to work properly anymore. When I create a new user and I log in for the first time, instead of mapping the Drupal user id with the civicrm user id, the module maps the drupal user id to a new ...Hi,
The group role sync module doesn't seem to work properly anymore. When I create a new user and I log in for the first time, instead of mapping the Drupal user id with the civicrm user id, the module maps the drupal user id to a new user that has everything blank apart from the email.
I checked in the database, and in the table uf_match to confirm and here is (I think) what the module does.
When a user logs in, the checking of the existing user doesn't work anymore, so a new user is created with only the email field and that new user civicrm id is mapped with the drupal id in the uf_match table.
This is causing a lot of problems in our website. I updated to the latest version, 5.17.3 but that didn't fix it either. I noticed this error since version 5.11https://lab.civicrm.org/dev/drupal/-/issues/81Drupal8: Large export results in logout2019-11-03T16:19:27ZJonGoldDrupal8: Large export results in logoutWhen you attempt a large export of CiviCRM data (~63K contacts, ~15 columns), Symfony kills the session. This is relatively recent behavior (didn't happen in April, for instance). Here are the watchdog logs:
Here are those stack traces,...When you attempt a large export of CiviCRM data (~63K contacts, ~15 columns), Symfony kills the session. This is relatively recent behavior (didn't happen in April, for instance). Here are the watchdog logs:
Here are those stack traces, more readable:
```
Warning: session_start(): Failed to decode session object. Session has been destroyed in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 149 of /var/www/crm.agbu.org/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php)
#0 /var/www/crm.agbu.org/web/core/includes/bootstrap.inc(587): _drupal_error_handler_real(2, 'session_start()...', '/var/www/crm.ag...', 149, Array)
#1 [internal function]: _drupal_error_handler(2, 'session_start()...', '/var/www/crm.ag...', 149, Array)
#2 /var/www/crm.agbu.org/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php(149): session_start()
#3 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/Session/SessionManager.php(164): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#4 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/Session/SessionManager.php(118): Drupal\Core\Session\SessionManager->startNow()
#5 /var/www/crm.agbu.org/vendor/symfony/http-foundation/Session/Session.php(57): Drupal\Core\Session\SessionManager->start()
#6 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpFoundation\Session\Session->start()
#7 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /var/www/crm.agbu.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /var/www/crm.agbu.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /var/www/crm.agbu.org/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/crm.agbu.org/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#15 {main}.
```
```
RuntimeException: Failed to start the session in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 150 of /var/www/crm.agbu.org/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php)
#0 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/Session/SessionManager.php(164): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#1 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/Session/SessionManager.php(118): Drupal\Core\Session\SessionManager->startNow()
#2 /var/www/crm.agbu.org/vendor/symfony/http-foundation/Session/Session.php(57): Drupal\Core\Session\SessionManager->start()
#3 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpFoundation\Session\Session->start()
#4 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /var/www/crm.agbu.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#6 /var/www/crm.agbu.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#7 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /var/www/crm.agbu.org/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /var/www/crm.agbu.org/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /var/www/crm.agbu.org/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#12 {main}.
```
The first issue is a warning that the session is too large, and so it destroys the session (which causes a logout). The second issue is of "error" severity saying the session can't be found.
Here's someone else having a similar issue in Symfony (not Drupal8): https://github.com/symfony/symfony/issues/26623tottentottenhttps://lab.civicrm.org/dev/drupal/-/issues/76Proposal: Don't migrate drush commands to D82020-06-19T16:21:14ZJonGoldProposal: Don't migrate drush commands to D8CiviCRM drush commands are incompatible with modern versions of drush.
I investigated this, and each command will need to be rewritten for drush 9/D8. I've created a framework and ported a couple of my most used commands (e.g. `drush c...CiviCRM drush commands are incompatible with modern versions of drush.
I investigated this, and each command will need to be rewritten for drush 9/D8. I've created a framework and ported a couple of my most used commands (e.g. `drush civicrm-sql-cli`, `drush civicrm-sql-dump`) but there's a compelling argument to simply not rewriting drush and instead making sure that `cv` has feature parity.
For those who DO think we should continue to maintain the drush commands, I have a branch here: https://github.com/MegaphoneJon/civicrm-drupal-8
Klaas has also submitted a PR to add `drush civicrm-api` to this branch.https://lab.civicrm.org/dev/drupal/-/issues/69Drupal8: Problem with user registration confirm email flow2020-09-18T09:50:52ZwannesderoyDrupal8: Problem with user registration confirm email flowIn our Drupal8 & CiviCRM setup we allow visitors to create accounts, with email verification. These users are created by CiviCRM when they sign up for a membership.
We encountered some issues around the registration process: the user wa...In our Drupal8 & CiviCRM setup we allow visitors to create accounts, with email verification. These users are created by CiviCRM when they sign up for a membership.
We encountered some issues around the registration process: the user was denied permission to the password form. And the onetime login link in the mail was always invalid.
In the CRM/Utils/System/Drupal8.php file we changed some of the user registration logic to be the same as the default Drupal 8 way.
1) First issue was that the user account was not set to 1 (active) when $verify_mail_conf was set to true. In default drupal this is the case.
2) Second issue was the user was logged in immediately after sending the verification mails, this should not happen when the verify_mail_conf setting is true. User may only be logged in when checking the mail and following the onetime login link.
[civicrm-core-d8-create-user-fix.patch](/uploads/876064009461686e9ef556adb5ae4676/civicrm-core-d8-create-user-fix.patch)https://lab.civicrm.org/dev/drupal/-/issues/64Drupal8/Backdrop: Bad URL on ACL page linking to CMS permissions2020-11-04T20:49:06ZJonGoldDrupal8/Backdrop: Bad URL on ACL page linking to CMS permissions`CRM_Admin_Page_Access::run()` attempts to generate a URL to the CMS permission page. It uses a switch to give a CMS-specific URL.
I wrote a Backdrop and D8-specific code, using `url()` and `\Drupal\Core\Url::fromUri()` respectively - ...`CRM_Admin_Page_Access::run()` attempts to generate a URL to the CMS permission page. It uses a switch to give a CMS-specific URL.
I wrote a Backdrop and D8-specific code, using `url()` and `\Drupal\Core\Url::fromUri()` respectively - but I think this is overcomplicated. Couldn't we just pass a string instead? Or is there some oddball situation (multi-site?) where you need to generate the URL using the Drupal-specific functions?JonGoldJonGoldhttps://lab.civicrm.org/dev/drupal/-/issues/62Possible rework on path checking on function civicrm_user_form_validate for 7...2021-02-05T10:40:39ZVangelisPPossible rework on path checking on function civicrm_user_form_validate for 7.x branchI have had some issues with a civicrm profile validation (even with the default `Name and Address`) when it was being exposed in the drupal user registration page after adding some ajax there.
Problem that appears when you ajaxify the ...I have had some issues with a civicrm profile validation (even with the default `Name and Address`) when it was being exposed in the drupal user registration page after adding some ajax there.
Problem that appears when you ajaxify the form itself, is that contents are getting replaced. When this happens, `civicrm_user_form_validate` doesn't work. Specifically, arg(0) & arg(1) are changing (see below).
Searching a little bit more, I have noticed on [line ~~681~~ 707](https://github.com/civicrm/civicrm-drupal/blob/7.x-master/civicrm.module#L707) that there's an arg() comparison so that Civi can understand what path users are coming from ([here](https://github.com/civicrm/civicrm-drupal/blob/7.x-master/civicrm.module#L694))
May I suggest (i can make a MR) instead of doing a path search using the arg() variable, check the form `#action` or `#user_category` instead, like:
* `$register = (($form['#action'] == '/user/register' || $form['#action'] == '/admin/people/create') ? TRUE : FALSE);`
or
* `$register = (($form['#user_category'] == 'account' || $form['#user_category'] == 'register')) ? TRUE : FALSE);` (This is taken from `user_account_form_validate` [function here](https://api.drupal.org/api/drupal/modules!user!user.module/function/user_account_form_validate/7.x))
This way, validation is always there, as long as the form `#action` or `#user_category` keeps the same name(s).
One relatively easy way to reproduce is this:
On a/any environment having Drupal 7.x:
* Download and enable [bootstrap](https://www.drupal.org/project/bootstrap) as the default theme
* Download and enable [bootstrap_login_modal](https://www.drupal.org/project/bootstrap_login_modal) which will add AJAX to the user login and user register form(s). This will also cause the non-validation issue i am referring to.
* Try to register yourself and don't add a first and last name, validation will not kick-in.
Now change the civicrm.module on line 681 with the above and re-try to register yourself. Validations will now work.
There is another issue there but it'm still looking at it: The warning comes back, eg. First name is a required field but the CiviCRM profile fields do not light up, they don't inherit the class `.has-error`.https://lab.civicrm.org/dev/drupal/-/issues/58Add Contact ID operator to the contact reference filter added in drupal view2019-04-24T06:50:11ZjitendraAdd Contact ID operator to the contact reference filter added in drupal viewContact Reference filter in a Drupal view only lets user to filter on sort_name. This field can have duplicate values on multiple contact records. It might be helpful if we could filter the results based on contact id.
Use-case
- Add a...Contact Reference filter in a Drupal view only lets user to filter on sort_name. This field can have duplicate values on multiple contact records. It might be helpful if we could filter the results based on contact id.
Use-case
- Add a contact ref custom field on a custom set extending individual. Eg `Alternate Contact Person`
- Add value to this field eg "Ashlie Adams".
- Suppose the db have more than one contact having the same sort name. eg id 203 and 206
- I need to create a Drupal view filtering values which have `Alternate Contact Person` set to contact id 203.
- The current set of filters will list all contacts for 203 and 206.
- This ticket is to address that limitation.jitendrajitendrahttps://lab.civicrm.org/dev/drupal/-/issues/52Drupal8: getUrlPath: avoid relying on the deprecated 'q' variable2020-05-27T12:49:03ZbgmDrupal8: getUrlPath: avoid relying on the deprecated 'q' variableContext: Symbiotic has an extension for theming that uses this trick to detect whether it's running in a frontend or backend form (to avoid loading our CSS on the frontend):
```
function adminimore_civicrm_config(&$config) {
$path = C...Context: Symbiotic has an extension for theming that uses this trick to detect whether it's running in a frontend or backend form (to avoid loading our CSS on the frontend):
```
function adminimore_civicrm_config(&$config) {
$path = CRM_Utils_System::getUrlPath();
$item = CRM_Core_Menu::get($path);
$resources = CRM_Core_Resources::singleton();
// if item is not known, assume it's public (e.g. wordpress shortcode)
if ($item && !CRM_Utils_Array::value('is_public', $item)) {
$resources->addStyleFile(ADMINIMORE_RESOURCE, 'css/civicrm-admin.css', 15, 'html-header');
$resources->addStyleFile(ADMINIMORE_RESOURCE, 'css/civicrm-buttons.css', 15, 'html-header');
}
$resources->addStyleFile(ADMINIMORE_RESOURCE, 'css/civicrm-menu.css', 15, 'html-header');
_adminimore_civix_civicrm_config($config);
}
```
In Drupal8, we were having weird problems where the CSS would sometimes not load. If we refreshed, it loaded, but after some time, the bug would appear again and we would stumble on a screen using the default CiviCRM CSS.
After some poking around, it seems that Drupal8 deprecated the 'q' variable, which CiviCRM is still using in `CRM_Utils_System::getUrlPath()`.
I did a quick patch to test a workaround, which so far seems to be working:
```
public static function getUrlPath() {
if (CRM_Core_Config::singleton()->userFramework == 'Drupal8') {
if (class_exists('Drupal') && \Drupal::hasContainer()) {
$path = \Drupal::service('path.current')->getPath();
// Remove '/' prefix. Ex: '/civicrm/contribute' becomes 'civicrm/contribute'.
if ($path) {
$path = substr($path, 1);
// Remove the language prefix, if present
// The URL returned by Drupal randomly includes the language prefix, sometimes not.
if (preg_match('/^\w\w\//', $path)) {
$path = substr($path, 3);
}
return $path;
}
}
}
if (isset($_GET[CRM_Core_Config::singleton()->userFrameworkURLVar])) {
return $_GET[CRM_Core_Config::singleton()->userFrameworkURLVar];
}
return NULL;
}
```
A cleaner solution might be to check if the `$config->userSystem->getUrlPath()` function exists, and if it does, call it?