Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
There appears to be a typo in commons_trusted_contacts.module line 476:
function commons_trusted_contacts_og_membership_delete(OgMembership $og_membership, $type) {
$type is not a valid parameter for hook_og_membership_delete() in OG API.
Proposed resolution
Remove $type, it is not referenced inside the function.
function commons_trusted_contacts_og_membership_delete(OgMembership $og_membership) {
if ($og_membership->type != 'trusted_contacts' || $og_membership->group_type != 'user') {
// Not a Trusted-Contact membership type.
return;
}
if (!og_is_member('user', $og_membership->etid, 'user', $og_membership->gid)) {
// Prevent recursion.
return;
}
// Delete the "opposite" OG membership too.
og_ungroup('user', $og_membership->etid, 'user', $og_membership->gid);
}
Comment | File | Size | Author |
---|---|---|---|
#3 | remove-type-2013467-3.patch | 722 bytes | Devin Carlson |
#1 | wikis_nid_does_not_exist-2013433-1.patch | 1.85 KB | stupiddingo |
Comments
Comment #1
stupiddingo CreditAttribution: stupiddingo commentedAnd patch.
Comment #2
ezra-g CreditAttribution: ezra-g commentedThanks, stupiddingo!
Tagging for review before Commons 3.3 is released.
Comment #3
Devin Carlson CreditAttribution: Devin Carlson commentedstupiddingo@ it looks like you meant to post #1 in #2013433: commons_wikis_og_user_access check $nid does not exist for new user-based groups.
A patch to make the change outlined in the OP.
Comment #4
stupiddingo CreditAttribution: stupiddingo commentedThe only explanation I can offer is the timestamp of 2am. Sheesh. Devin, your #3 patch above matches mine and works for me on an existing and clean install. Thanks! /brent
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedCommitted #3 to Commons Trusted Contacts & Private Messaging 7.x-3.x. Thanks!
http://drupalcode.org/project/commons_trusted_contacts.git/commit/69acd04