If the $bundle parameter is passed to MembershipEntityController::loadByUser() and the account has at least one membership and none of these memberships are of type $bundle, then you'll get an undefined index notice because of this line:

return !empty($bundle) ? $return[$bundle] : $return;

Comments

joelstein created an issue. See original summary.

joelstein’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

Here's a patch which returns FALSE if $bundle is provided and the user has a non-$bundle membership.

draenen’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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