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.

Comments

MrDaleSmith created an issue. See original summary.

mrdalesmith’s picture

Patch to resolve issue.

  • Rob230 committed 8bbcc6a on 8.x-2.x
    Issue #3244882 by MrDaleSmith: Deleting user with active license causes...
rob230’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.