Warning: key() expects parameter 1 to be array, null given in commons_trusted_contacts_og_membership_update() (line 516 of /Users/jimmy/Sites/Dev Desktop2/commons-7.x-3.9-core/profiles/commons/modules/commons/commons_trusted_contacts/commons_trusted_contacts.module).
EntityMetadataWrapperException: Unable to set the data property state as the parent data structure is not set. in EntityStructureWrapper->setProperty() (line 473 of /Users/jimmy/Sites/Dev Desktop2/commons-7.x-3.9-core/profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc).

When approving a trusted contact in 3.9.

Comments

garyconroy’s picture

Confirm. I am seeing the same behaviour

BarisW’s picture

Same here, any thoughts?

BarisW’s picture

Version: 7.x-3.9 » 7.x-3.x-dev
Status: Active » Needs review

I'm not sure what this piece of code does:

<?php
  // Set the second OG Membership according to the first one.
  // As we are referencing the requesting user to the requested user, we want to
  // keep everything synced.
  $query = new EntityFieldQuery();
  $return = $query
    ->entityCondition('entity_type', 'og_membership')
    ->propertyCondition('group_type', 'user')
    ->propertyCondition('entity_type', 'user')
    ->propertyCondition('etid', $og_membership->gid)
    ->propertyCondition('gid', $og_membership->etid)
    ->execute();
?>

But if I change it to

<?php
  $query = new EntityFieldQuery();
  $return = $query
    ->entityCondition('entity_type', 'og_membership')
    ->propertyCondition('group_type', 'user')
    ->propertyCondition('entity_type', 'user')
    ->propertyCondition('etid', $og_membership->etid)
    ->propertyCondition('gid', $og_membership->gid)
    ->execute();
?>

It seems to work. Note the propertyConditions for gid and etid.

obynz’s picture

Hi,

I just did the same as #3 and it worked for me.

japerry’s picture

Assigned: Unassigned » japerry

Testing this, as well as making sure groups are being assigned to each other. It appears group membership isn't going both ways when people add each other as trusted contacts.

  • Commit 22fbebe on 7.x-3.x by japerry:
    Issue #2234815 by japerry: gracefully fail if a trusted contact link is...
japerry’s picture

Status: Needs review » Postponed (maintainer needs more info)

Fixed! (Sorta)

I committed this patch to help surpress the error message:
http://drupalcode.org/project/commons.git/commit/22fbebe

However, the fix mentioned above will not fix the trusted contacts problem of approving another member. When a membership is approved, both members should be joined to each other, which is why we have opposite ids being inserted. I couldn't reproduce the issue you had, so once we release 3.10, let me know what watchdog errors you get and we can further debug from there.

lsolesen’s picture

Status: Postponed (maintainer needs more info) » Fixed

@japerry seems to have fixed this, so closing. Please reopen if this is still a problem.

Status: Fixed » Closed (fixed)

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