Drupal issueshttps://lab.civicrm.org/dev/drupal/-/issues2024-02-27T01:13:41Zhttps://lab.civicrm.org/dev/drupal/-/issues/65Drupal7: civicrm_rules - Add/Remove contact from CiviCRM Group works with dep...2024-02-27T01:13:41ZVangelisPDrupal7: civicrm_rules - Add/Remove contact from CiviCRM Group works with deprecated method on removal### Problem/Motivation
In the the civicrm_rules module, specifically `drupal/modules/civicrm_rules/civicrm_rules_utils.inc` and on line 64 there's this function `_civicrm_rules_group_contact` that by default uses the 'create' action if ...### Problem/Motivation
In the the civicrm_rules module, specifically `drupal/modules/civicrm_rules/civicrm_rules_utils.inc` and on line 64 there's this function `_civicrm_rules_group_contact` that by default uses the 'create' action if we want to add a contact into a CiviCRM Group which works absolutely fine.
However, when we want to delete a contact, this is what is initially being called:
`civicrm_api('group_contact', 'delete', $params);`
which I believe as an action it is now considered as deprecated and (most probably because of that), it's behaving weird:
It will remove a contact from a static group, but it will not remove a contact from a smartgroup.
### Steps to reproduce
Create a rule so that it has an action that will remove an existing CiviCRM contact from a group on webform submission (or something related to that).
Outcome:
* Rule will apply and contact will be removed if that group that he belongs to is a static group
* Rule will not apply and contact will **not** be removed if that group that he belongs to is a smartgroup
### Proposed resolution
Current function:
```php
/**
* Function to add contacts to group
*/
function _civicrm_rules_group_contact($contactId, $groupId, $action = 'create') {
civicrm_initialize();
$params = array(
'contact_id' => $contactId,
'group_id' => $groupId,
'version' => 3,
);
// This used to be civicrm_group_contact_common($params, $action);
civicrm_api('group_contact', $action, $params);
}
```
Proposed change:
```php
/**
* Function to add/remove contacts to group
*/
function _civicrm_rules_group_contact($contactId, $groupId, $action = 'create') {
civicrm_initialize();
$params = array(
'contact_id' => $contactId,
'group_id' => $groupId,
'version' => 3,
);
if ($action == 'delete') {
$params['status'] = 'Removed';
}
// This used to be civicrm_group_contact_common($params, $action);
civicrm_api('group_contact', 'create', $params);
}
```
Basically we keep the action as 'create' and then we intercept the incoming $action variable.
If it has the 'delete' value, we add to the $params the 'status' = 'Removed' so that it can remove it.
I tried that fix and it works for me but i would ask you to replicate it in your environment(s) as well.https://lab.civicrm.org/dev/drupal/-/issues/194Recent Items block on the non-CiviCRM pages will have a missing CRM JS error2024-02-22T16:59:37ZherbdoolRecent Items block on the non-CiviCRM pages will have a missing CRM JS errorWe've got a site where the Recent Items block is on a non-CiviCRM page. It seems to work but there's a JS error of the `CRM` object is missing. I had put `\CRM_Core_Resources::singleton()->addCoreResources();` in a custom event subscribe...We've got a site where the Recent Items block is on a non-CiviCRM page. It seems to work but there's a JS error of the `CRM` object is missing. I had put `\CRM_Core_Resources::singleton()->addCoreResources();` in a custom event subscriber but that no longer plays nice with CiviCRM core. So perhaps adding it to the `CivicrmBlock` plugin class would be better. It seems that Drupal can't assume that the block will have everything loaded. In my testing, adding it in `__construct()` after `$civicrm->initialize();` works.5.72.0https://lab.civicrm.org/dev/drupal/-/issues/133Breadcrumb error on CiviCRM admin pages (Drupal 8)2023-12-13T17:46:26ZW01FBreadcrumb error on CiviCRM admin pages (Drupal 8)Getting the following error on several CiviCRM admin pages, including /civicrm/admin
```
Warning: Invalid argument supplied for foreach() in CRM_Utils_System_Drupal8->appendBreadCrumb() (line 190 of /home/customer/www/youpickfarms.org/v...Getting the following error on several CiviCRM admin pages, including /civicrm/admin
```
Warning: Invalid argument supplied for foreach() in CRM_Utils_System_Drupal8->appendBreadCrumb() (line 190 of /home/customer/www/youpickfarms.org/vendor/civicrm/civicrm-core/CRM/Utils/System/Drupal8.php).
CRM_Utils_System_Drupal8->appendBreadCrumb('Administer CiviCRM', '/civicrm/admin?reset=1') (Line: 60)
CRM_Utils_System::__callStatic('appendBreadCrumb', Array) (Line: 76)
CRM_Contact_Form_Domain->preProcess() (Line: 599)
CRM_Core_Form->buildForm() (Line: 120)
CRM_Core_StateMachine->perform(Object, 'next', 'Next') (Line: 45)
CRM_Core_QuickForm_Action_Next->perform(Object, 'next') (Line: 203)
HTML_QuickForm_Controller->handle(Object, 'next') (Line: 103)
HTML_QuickForm_Page->handle('next') (Line: 347)
CRM_Core_Controller->run() (Line: 98)
CRM_Utils_Wrapper->run('CRM_Contact_Form_Domain', 'Organization Address and Contact Info', Array) (Line: 285)
CRM_Core_Invoke::runItem(Array) (Line: 68)
CRM_Core_Invoke::_invoke(Array) (Line: 36)
CRM_Core_Invoke::invoke(Array) (Line: 88)
Drupal\civicrm\Civicrm->invoke(Array) (Line: 80)
Drupal\civicrm\Controller\CivicrmController->main(Array, '')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```5.70.0https://lab.civicrm.org/dev/drupal/-/issues/20Manual synchronization of CiviCRM memberships and Drupal roles gives error2023-11-09T23:29:43Zcarbar1103Manual synchronization of CiviCRM memberships and Drupal roles gives errorHello.
I am just starting to get memberships and roles sorted out in my CiviCRM. When I go to Home » Administration » Configuration » CiviCRM » CiviMember Roles Sync » Manually Synchronize and click the button, I get a popup saying "Th...Hello.
I am just starting to get memberships and roles sorted out in my CiviCRM. When I go to Home » Administration » Configuration » CiviCRM » CiviMember Roles Sync » Manually Synchronize and click the button, I get a popup saying "There was an error. CiviMember Memberships and Drupal Roles could not be synchronized." The Drupal log just says "unknown error".
On investigation, the problem appears in drupal/modules/civicrm_member_roles/civicrm_member_roles.module, line 530, in the method _civicrm_member_roles_sync():
```
$contacts = CRM_Core_DAO::executeQuery($sql, $params);
if ($contacts->N == 0) {
watchdog('civicrm_member_roles',
$errorMsg,
$errorParams,
WATCHDOG_ERROR
);
return FALSE;
}
```
It is running the following sql:
```
SELECT DISTINCT uf.contact_id, m.end_date FROM civicrm_uf_match uf
LEFT JOIN civicrm_membership m ON uf.contact_id = m.contact_id
WHERE m.id IS NOT NULL AND m.membership_type_id IN (1)
ORDER BY m.end_date DESC
```
which is returning zero rows. This is probably because I haven't got the necessary roles/contacts/etc set up, but it is a bit of an odd error.
Regards,
Carlhttps://lab.civicrm.org/dev/drupal/-/issues/84Drupal7: use label instead of name in membership views2023-11-09T23:27:57ZwdecraeneDrupal7: use label instead of name in membership viewsIn `drupal/modules/views/components/civicrm.member.inc` add two times 'pseudo args' so (translated) labels are used instead of machine names.
```php
//Membership Status
$data['civicrm_membership']['status'] = array(
'title' => t...In `drupal/modules/views/components/civicrm.member.inc` add two times 'pseudo args' so (translated) labels are used instead of machine names.
```php
//Membership Status
$data['civicrm_membership']['status'] = array(
'title' => t('Status'),
'real field' => 'status_id',
'help' => t('The Status of the Membership'),
'field' => array(
'handler' => 'civicrm_handler_field_pseudo_constant',
'click sortable' => TRUE,
'pseudo class' => 'CRM_Member_PseudoConstant',
'pseudo method' => 'membershipStatus',
'pseudo args' => array(NULL, NULL, 'label'),
),
'argument' => array(
'handler' => 'views_handler_argument',
),
'filter' => array(
'handler' => 'civicrm_handler_filter_pseudo_constant',
'allow empty' => TRUE,
'pseudo class' => 'CRM_Member_PseudoConstant',
'pseudo method' => 'membershipStatus',
'pseudo args' => array(NULL, NULL, 'label'),
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
```https://lab.civicrm.org/dev/drupal/-/issues/186drupal 9: Create User Record action crashes if using first+last+email as unsu...2023-07-05T23:49:05ZDaveDdrupal 9: Create User Record action crashes if using first+last+email as unsupervised ruleSee https://civicrm.stackexchange.com/questions/44841/create-user-record-action-on-a-contact-summary-page-throws-error-is-this-a-bug
Putting as regression for now but not completely sure.
Doesn't happen in drupal 7.See https://civicrm.stackexchange.com/questions/44841/create-user-record-action-on-a-contact-summary-page-throws-error-is-this-a-bug
Putting as regression for now but not completely sure.
Doesn't happen in drupal 7.5.63.0https://lab.civicrm.org/dev/drupal/-/issues/153Drupal 8 profile validation not finding the right profile when validating sub...2023-02-15T06:04:10ZDaveDDrupal 8 profile validation not finding the right profile when validating submission on CMS user tabsIn drupal 8/9, like in drupal 7, the CMS user record by default has the Name and Address profile available for editing on the CMS side. As noted in passing at https://lab.civicrm.org/dev/drupal/-/issues/117#note_40124 the validation for ...In drupal 8/9, like in drupal 7, the CMS user record by default has the Name and Address profile available for editing on the CMS side. As noted in passing at https://lab.civicrm.org/dev/drupal/-/issues/117#note_40124 the validation for this form isn't working fully in drupal 8/9.
It appears to be a name vs label problem. The drupal 8 implementation uses the label to look up the profile. I have a quickie fix below but am mulling it over a bit since there's a lot of other things wrong with this form, e.g.
* https://lab.civicrm.org/dev/drupal/-/issues/113
* https://lab.civicrm.org/dev/drupal/-/issues/117
* https://lab.civicrm.org/dev/core/-/issues/2301
```diff
index 37e7ead..b18bb04 100644
--- a/src/Form/UserProfile.php
+++ b/src/Form/UserProfile.php
@@ -75,7 +75,12 @@ class UserProfile extends FormBase {
$this->profile = $profile;
// Search for the profile form, otherwise generate a 404.
- $uf_groups = \CRM_Core_BAO_UFGroup::getModuleUFGroup('User Account');
+ $uf_groups = \CRM_Core_BAO_UFGroup::getModuleUFGroup('User Account', 0, TRUE, \CRM_Core_Permission::VIEW, array(
+ 'id',
+ 'name',
+ 'title',
+ 'is_active',
+ ));
if (empty($uf_groups[$profile])) {
throw new ResourceNotFoundException();
}
@@ -109,7 +114,7 @@ class UserProfile extends FormBase {
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
- $errors = \CRM_Core_BAO_UFGroup::isValid($this->contactId, $this->ufGroup['title']);
+ $errors = \CRM_Core_BAO_UFGroup::isValid($this->contactId, $this->ufGroup['name']);
if (is_array($errors)) {
foreach ($errors as $name => $error) {
```
Relatedly, this seems an odd return value if it couldn't find the profile. Shouldn't it return an error?
https://github.com/civicrm/civicrm-core/blob/a7b9631b60548092f8c3056c375dd4b81606dbd4/CRM/Core/BAO/UFGroup.php#L785
FYI @alandixon @spalmstrom5.59.0https://lab.civicrm.org/dev/drupal/-/issues/110Address no longer available as Relationship for Views in Drupal 72022-10-08T12:19:55ZherbdoolAddress no longer available as Relationship for Views in Drupal 7It seems to me this was working in CiviCRM 5.21 (just tested and it's there) and no longer in 5.22 or 5.23.
A diff of commits in `civicrm-drupal` didn't look suspicious to me but perhaps I'm missing something. Perhaps it's in `civicrm-c...It seems to me this was working in CiviCRM 5.21 (just tested and it's there) and no longer in 5.22 or 5.23.
A diff of commits in `civicrm-drupal` didn't look suspicious to me but perhaps I'm missing something. Perhaps it's in `civicrm-core`?
Error message:
> https://www.example.com/admin/structure/views/ajax/add-item/member_lists/default/relationship
> Notice: Undefined index: base in view->get_base_tables() (line 758 of /var/www/vhosts/example.com/httpdocs/sites/default/modules/views/includes/view.inc). |5.25.0https://lab.civicrm.org/dev/drupal/-/issues/31CiviMember Role sync is no longer syncing Pending memberships2022-10-08T12:04:06ZjitendraCiviMember Role sync is no longer syncing Pending membershipsPending membership does not sync roles even if the option is configured in the settings page.Pending membership does not sync roles even if the option is configured in the settings page.5.9jitendrajitendrahttps://lab.civicrm.org/dev/drupal/-/issues/174Change message so it doesn't say Drupal8 on Drupal9 site2022-09-20T22:27:16ZJoeMurrayChange message so it doesn't say Drupal8 on Drupal9 siteThere was a message today on page for Synchronize Users to Contacts (/civicrm/admin/synchuser:
Synchronize Drupal8 Users
This was on a Drupal9 site, and the client got concerned about what they were running.
Please adjust the message s...There was a message today on page for Synchronize Users to Contacts (/civicrm/admin/synchuser:
Synchronize Drupal8 Users
This was on a Drupal9 site, and the client got concerned about what they were running.
Please adjust the message so that it either refers to just Drupal or ideally emits the correct major version of Drupal, eg Drupal9, Drupal10, etc.5.55.0Monish DebMonish Debhttps://lab.civicrm.org/dev/drupal/-/issues/79Error when upgrading to 5.16.02022-08-12T05:14:12ZJGauntError when upgrading to 5.16.0Not sure if this is the right place to add the issue so apologies in advance.
I've attempted to upgrade three separate sites on three separate servers from 5.14 and 5.15 to 5.16.0 and all three came back with the following error:
Error...Not sure if this is the right place to add the issue so apologies in advance.
I've attempted to upgrade three separate sites on three separate servers from 5.14 and 5.15 to 5.16.0 and all three came back with the following error:
Error: syntax error, unexpected ':', expecting '{' in /home/example/public_html/sites/all/modules/civicrm/vendor/league/csv/src/functions.php, line 33
The three sites are all on Drupal 7 on PHP 7.1 although I did upgrade one temporarily to 7.2 and also 7.3 to see if that made a difference which it didn't.
I'm used to upgrading civi on many different sites all the time so I don't believe it to be a fault of my own.
I tried to upgrade the usual way:
- Delete old codebase
- Unpack new code base
- Run 'drush civicrm-upgrade-db'
It is when I enter the drush command the error flags up and the update fails. I've used the same method countless times in the past so I do think there is an issue somewhere.
Thanks,
Jade5.16.3https://lab.civicrm.org/dev/drupal/-/issues/179KCFinder on D9: You don't have permissions to browse server.2022-08-12T05:14:07ZSandor SemseyKCFinder on D9: You don't have permissions to browse server.## Overview
The issue is very similar to this one:
https://civicrm.stackexchange.com/questions/41023/cannot-upload-images-using-ckeditor-on-message-template-after-5-45-upgrade
and the proposed workaround is solving it (reverting [this...## Overview
The issue is very similar to this one:
https://civicrm.stackexchange.com/questions/41023/cannot-upload-images-using-ckeditor-on-message-template-after-5-45-upgrade
and the proposed workaround is solving it (reverting [this](https://github.com/civicrm/civicrm-packages/commit/0bb407782b810c32a81e0ad42af67a435b44c845) commit), but I think the root cause is different.
**Steps to reproduce**
1. Use CKEditor4 as Wysiwig Editor
1. Create Event
1. Insert image to description
1. Try to browse, or upload image
1. Error: You don't have permissions to browse server.
## Analysis
In my case classes are found, so it's not namespacing. After some debugging, I think the following happens:
1. In `civicrm/packages/kcfinder/integration/civicrm.php` Drupal is bootstrapped, user authenticated and correct `KCFINDER` params are added to the `$_SESSION` var:
```
$_SESSION['KCFINDER']['disabled'] = false;
$_SESSION['KCFINDER']['uploadURL'] = $config->imageUploadURL;
$_SESSION['KCFINDER']['uploadDir'] = $config->imageUploadDir;
```
1. Then in `\kcfinder\uploader::construct()` session ID is requested from Drupal (`\CRM_Core_Config::singleton()->userSystem->getSessionId()`)
1. Eventually `Drupal\Core\Session\SessionManager::start()` finds no session so starts a new one, thus removing `KCFINDER` array from `$_SESSION`. This way kcfinder defaults are used, which is to disable access.
So I thought it's a cookie issue (though `$_COOKIE` was populated with all the cookies all the way through).
I changed `CRM_Utils_System_Drupal8::loadBootStrap()` to pass cookies to the Symfony request:
```
$request = new \Symfony\Component\HttpFoundation\Request([], [], [], $_COOKIE, [], $_SERVER);
```
This way session was found in step 3 above, it was restored, but it also didn't contained the `KCFINDER` array as `$_SESSION` was overwritten by restoring.
So I'm stuck here, probably I'm missing something obvious, but currently I can't see why should it behave differently.
Has anybody any idea?
**Drupal: 9.3.12**
**Civi: 5.47.4**
## UPDATE
Relevant issues in other repos:
https://lab.civicrm.org/dev/core/-/issues/3419#note_74113
https://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues/45.51.0https://lab.civicrm.org/dev/drupal/-/issues/181Error: Trying to access array offset on value of type null in Drupal\civicrm\...2022-08-05T00:42:28ZherbdoolError: Trying to access array offset on value of type null in Drupal\civicrm\Plugin\Block\CivicrmBlock->build### Error:
> Notice: Trying to access array offset on value of type null in Drupal\civicrm\Plugin\Block\CivicrmBlock->build() (line 57 of modules/contrib/civicrm/src/Plugin/Block/CivicrmBlock.php).
### How to recreate
1. Add the block...### Error:
> Notice: Trying to access array offset on value of type null in Drupal\civicrm\Plugin\Block\CivicrmBlock->build() (line 57 of modules/contrib/civicrm/src/Plugin/Block/CivicrmBlock.php).
### How to recreate
1. Add the block Recent Items to a blocks layout. I don't think it matters if it's the front or admin side. And this may be an issue with other blocks too.
2. Log in as a user *without* the `access CiviCRM` permission and visit a page where that block is supposed to appear.
### Background
`CivicrmBlock::build()` has this line `$content = \CRM_Core_Block::getContent($block_id)['content'];`. But `getContent()` can return `NULL` (despite it claiming it only returns arrays). It'll return NULL if various access checks fail.
### What should happen
`CivicrmBlock::build()` should first check the result is an array before trying to access an offset.
```
/**
* {@inheritdoc}
*/
public function build() {
$block_id = $this->getDerivativeId();
$content = \CRM_Core_Block::getContent($block_id);
// Bypass Drupal SafeString escaping by setting output as already escaped.
if (!empty($content['content']) {
return [
'#markup' => Markup::create($content['content']),
'#cache' => ['max-age' => 0],
];
}
return [];
}
```5.53.0https://lab.civicrm.org/dev/drupal/-/issues/75[regression] `cv` fails on CiviCRM 5.15.02022-04-06T22:13:17ZJonGold[regression] `cv` fails on CiviCRM 5.15.0Any command that attempts to access Civi fails with:
```
[RuntimeException]
Cannot resolve path using "cms.root.url"
```
Civi 5.14.2 works fine.
The issue is `CRM...Any command that attempts to access Civi fails with:
```
[RuntimeException]
Cannot resolve path using "cms.root.url"
```
Civi 5.14.2 works fine.
The issue is `CRM_Utils_System_Drupal8::languageNegotiationURL()`, which was added in 5.15.0. Removing this function restores the correct behavior, but I assume has a detrimental effect on multilingual.
The underlying cause of the error is hidden because of a later PR by @bgm that accounts for the REST API. If you roll back his change, the error becomes:
```
[Drupal\Core\DependencyInjection\ContainerNotInitializedException]
\Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.
```5.16.0https://lab.civicrm.org/dev/drupal/-/issues/169"Your browser session has expired and we are unable to complete your form sub...2022-03-16T00:19:54ZJonGold"Your browser session has expired and we are unable to complete your form submission" on all D9.2 anonymous sessions### Overview
This is an expensive bug, so I'm reporting it even though I don't have complete information.
On all D9.2 sites, anonymous users whose first visit to a CiviCRM page is a contribution or event registration page, will receive ...### Overview
This is an expensive bug, so I'm reporting it even though I don't have complete information.
On all D9.2 sites, anonymous users whose first visit to a CiviCRM page is a contribution or event registration page, will receive the error "Your browser session has expired and we are unable to complete your form submission" on submission. If they resubmit the page it will go through.
### Steps to Replicate
* Install a fresh D8 buildkit site.
* Upgrade to D9.2.0 or higher.
* Open an incognito window and paste in the URL to an event/contribution page (easiest to test if it's a free event with a confirmation page).
* Submit the page. See the error.
### Analysis
I'm still tracking this down and I don't really know the Civi session manager well - but on initial page load, `CRM_Core_Key::sessionID()` returns an empty string. On submitting the form, it finds a session ID correctly, so in `CRM_Core_Key::validate()` the expected key doesn't match the actual key.
While debugging, it's good to note that you can `composer update` to switch between D9.1.3 and D9.2.8 to switch between unbugged and bugged behavior.
It looks like this is the cause:
https://www.drupal.org/node/30063065.43.2https://lab.civicrm.org/dev/drupal/-/issues/113hook_civicrm_buildProfile not working on Drupal 82022-02-24T00:33:56ZAlanDixonhook_civicrm_buildProfile not working on Drupal 8The buildProfile hook as documented here:
https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildProfile/
doesn't work in Drupal 8, at least not on the user's corresponding profile tab.
Specifically, the ability to add css/js to...The buildProfile hook as documented here:
https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildProfile/
doesn't work in Drupal 8, at least not on the user's corresponding profile tab.
Specifically, the ability to add css/js to a profile form fails, e.g. like the example in the documentation:
CRM_Core_Resources::singleton()->addScriptFile('org.example.myext', 'some/fancy.js', 100);
The hook fires with the correct profile name, but adding any resources does not result in those resources showing up on the Drupal users's profile page.
I believe the error is in src/Form/UserProfile.php where the form html is generated and returned without checking for any associated resources.
One way of fixing it is to only support the 'form-bottom' region, and add the resources in the buildForm function, e.g.
`$html .= \CRM_Core_Region::instance('form-bottom')->render('', FALSE);`
after line 86 of that file.
There are lots of other civicrm resources that are not included, and maybe that's a good thing on purpose.5.40.0https://lab.civicrm.org/dev/drupal/-/issues/54Drupal8 CiviCRM conflicts with Masquerade module2022-02-24T00:33:50ZJonGoldDrupal8 CiviCRM conflicts with Masquerade moduleReported on d.o originally by jptillman (who is on chat.c.o with the same name) in the Masquerade queue: https://www.drupal.org/project/masquerade/issues/3019665
I confirmed the same issue, and also confirmed that uninstalling CiviCRM r...Reported on d.o originally by jptillman (who is on chat.c.o with the same name) in the Masquerade queue: https://www.drupal.org/project/masquerade/issues/3019665
I confirmed the same issue, and also confirmed that uninstalling CiviCRM resolves this issue. This fits a pattern of Civi having some sort of incorrect interaction with the D8 user login - see #53, core#231, and [CRM-19878](https://issues.civicrm.org/jira/browse/CRM-19878) for other examples.5.41.0https://lab.civicrm.org/dev/drupal/-/issues/172Deprecated function drupal_get_installed_schema_version() in 9.3, but with a ...2022-01-02T15:47:07ZDaveDDeprecated function drupal_get_installed_schema_version() in 9.3, but with a twistdrupal_get_installed_schema_version() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\UpdateHookRegistry::getInstalledVersion() or \Drupal\Core\Update\UpdateHookRegistry::getAllInstalledVersions()...drupal_get_installed_schema_version() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\UpdateHookRegistry::getInstalledVersion() or \Drupal\Core\Update\UpdateHookRegistry::getAllInstalledVersions() instead. See https://www.drupal.org/node/2444417
This is in vendor\civicrm\civicrm-core\CRM/Utils/System/Drupal8.php:
```
public function getModules() {
$modules = [];
$module_data = \Drupal::service('extension.list.module')->reset()->getList();
foreach ($module_data as $module_name => $extension) {
if (!isset($extension->info['hidden']) && $extension->origin != 'core') {
$extension->schema_version = drupal_get_installed_schema_version($module_name);
$modules[] = new CRM_Core_Module('drupal.' . $module_name, ($extension->status == 1));
}
}
return $modules;
}
```
The reason I haven't just put up a simple replacement PR is because if you look at the above function you'll notice schema_version is never used. If you look at the docblock in Base.php it says "List modules installed in the CMS, _including enabled and disabled ones_." Looking at the drupal 7 version (in DrupalBase.php), it does this:
`'SELECT name, status FROM {system} WHERE type = \'module\' AND schema_version <> -1'`
which means only the modules that are installed (but possibly disabled - that's what status is). Now in drupal 8 there is no concept of disabled, it's either installed or uninstalled, but the drupal 8 code is including all of them. In drupal 8 $extension->status means installed or uninstalled.
So two options are:
1. Try to match the drupal 7 implementation/docblock, which means excluding it if $extension->status is 0, and always passing 1 as the second parameter to CRM_Core_Module(), because disabled doesn't mean anything in drupal 8.
2. Leave it the way it is and just remove the unused line about schema_version.
Trying to track down where this gets used, it seems it's mostly in ManagedEntities, which I usually stay away from, and I'm not even sure why ManagedEntities would be dealing with drupal modules other than civicrm itself.
So I'm tempted to stop thinking about it and do item 2.5.46.0https://lab.civicrm.org/dev/drupal/-/issues/163Session erroneously getting set to NULL on Drupal user login2021-11-11T23:32:18ZsteveplatzSession erroneously getting set to NULL on Drupal user loginAnonymous sessions may contain data that needs to be retained after login, for example commerce cart data. In the initialize() method of the core session class civicrm/civicrm-core/CRM/Core/Session.php, there is a check for a changed ses...Anonymous sessions may contain data that needs to be retained after login, for example commerce cart data. In the initialize() method of the core session class civicrm/civicrm-core/CRM/Core/Session.php, there is a check for a changed session id, which if it evaluates to TRUE will set a current session with data to NULL.
```php
// remove $_SESSION reference if session is changed
if (($sid = session_id()) !== $this->sessionID) {
$this->_session = NULL;
$this->sessionID = $sid;
}
```
I've tested this with Drupal 9.2.4 CiviCRM 5.35 and Drupal Commerce 2.26. This specific change was added in https://lab.civicrm.org/dev/drupal/-/issues/98 for Drupal 7.5.43.0https://lab.civicrm.org/dev/drupal/-/issues/166Drupal function ip_address no longer exists after D72021-09-22T13:02:47ZAlanDixonDrupal function ip_address no longer exists after D7There are times where CiviCRM likes to know who it's talking to, i.e. the ip address of the visitor.
This matters especially when it gets passed on to a payment processor.
Here's a utility function that does that: https://github.com/ci...There are times where CiviCRM likes to know who it's talking to, i.e. the ip address of the visitor.
This matters especially when it gets passed on to a payment processor.
Here's a utility function that does that: https://github.com/civicrm/civicrm-core/blob/b599743f3daa46ab96c09ebe410fbb833cdd080f/CRM/Utils/System.php#L1293
This code is fairly naive, but makes use of the fact that Drupal 7 (and earlier) that had a function ip_address that would pay attention to the drupal configuration to be able to deal with front end proxies (like Varnish/hitch).
Unfortunately, D8/9 no longer includes this function, as also noted in this issue for iATS payments.
https://github.com/iATSPayments/com.iatspayments.civicrm/issues/370
Should we continue to provide spaghetti/cms-specific support for front end proxy confusion here? Are there better ways of doing this?