Problem/Motivation
Deleting a user who has an active license causes the error 'TypeError: Argument 2 passed to Drupal\og\MembershipManager::getMembership() must implement interface Drupal\Core\Session\AccountInterface, null given, called in /var/www/prod/csp/site/modules/contrib/commerce_license_og_role/src/Plugin/Commerce/LicenseType/OgRole.php on line 237 in Drupal\og\MembershipManager->getMembership() (line 133 of /var/www/prod/csp/site/modules/contrib/og/src/MembershipManager.php).'
Steps to reproduce
Delete a user who has an active license.
Proposed resolution
This is caused by the call to $license->getOwner() in the revoke function, whicg cannot return a user who has been deleted. The owner entity is assumed to exist and passed straight to $this->ogMembershipManager->getMembership() causing the error.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | commerce_license_og_role-deleting-user-with-active-role-3244882-2.patch | 4.2 KB | mrdalesmith |
Comments
Comment #2
mrdalesmith commentedPatch to resolve issue.
Comment #4
rob230 commented