I am using the latest GA release of Open Atrium 2.x. On some spaces, I get this error message:

Notice: Trying to get property of non-object in _oa_core_build_visibility_links() (line 495 of /var/www/dev.skinsense.com/profiles/openatrium/modules/contrib/oa_core/includes/oa_core.access.inc).

The error message is repeated several times. I have not yet identified the specific cause of the message.

I found this Issue but have found no resolution. The issue is still open.

HAJ

Comments

hefox’s picture

That function is used for two panes, 'Content Visibility' and 'Visibility toolbar', the former has a required node context and later checks if $node->type is set

The function is passed a $node variable that based on ^ should be set to a node. Then it does the below checking, which should result in $section_node being set to a node (cause of the empty( check).

    if ($node->type == OA_SECTION_TYPE) {
      $section_node = $node;
    }
    else {
      $section_reference_field = field_get_items('node', $node, OA_SECTION_FIELD);
      $section_node = node_load($section_reference_field[0]['target_id']);
    }
    if (empty($section_node)) {
      $section_node = $node;
    }
      $data['public'] = (($section_node->type != OA_SECTION_TYPE) || oa_core_section_is_public($section_node))
        && empty($visibility[0]['value']);

Is the line 495

So... how is that function on your install getting an invalid $section_node? Don't see how that could be happening unless something else is causing it or such, hard to debug without being able to reproducing it myself

the output of

static $once;
if (!isset($section_node->type) && !$once) {
  $once = TRUE;
  drupal_set_message(print_r(debug_backtrace(), 1));
}

would be helpful

jacobson’s picture

Status: Active » Closed (cannot reproduce)