I received the following notifications after enabling the Flag module. og.module is assuming that the original property will always exist in the og_node_update function, but that appears not to be true if other modules are involved.

Notice: Undefined property: stdClass::$original in og_node_update() (line 809 of .... /sites/all/modules/og/og.module).
Notice: Trying to get property of non-object in og_node_update() (line 809 of .... /sites/all/modules/og/og.module).

I was wondering about the danger of inserting a test for the existence of the original property first in the functions, such as the following.

function og_node_update($node) {
  if (property_exists($node, 'original') && $node->uid != $node->original->uid && $group = og_get_group('node', $node->nid)) {
    $account = user_load($node->uid);
    $values = array('entity' => $account);
    og_group($group->gid, $values);
  }
}

It does solve my immediate problem, but I'm not sure what issues it may cause.

Comments

dotist’s picture

i'm having the same thing. i think this is occurring while a custom module & OG are working on the same node at the same time. did you ever find a different solution for this? thx...

David4514’s picture

My immediate solution was to discontinue the use of the flag module. Later, I migrated to OG 7.x-2.x which no longer even has the function that I suspected as the cause of the problem.