When using organic groups user roles, the add child page link produces an access denied error for users who do not have permission to create the content type outside of the context of the group.

My solution was to modify outline.module's outline_link function to include the gid in the query for the add child link:

	 if (module_exists('og') && module_exists('og_user_roles') && $thegroup = og_get_group_context()) {
	      $gidpath = '&gids[]='.$thegroup->nid;
	 }
          if (node_access('create', $child_type) && 1 == $node->status && $node->book['depth'] < MENU_MAX_DEPTH) {
            $links['outline_add_child'] = array(
              'title' => t('Add child !node_type', array( '!node_type' => node_get_types('name', $child_type))),
              'href' => "node/add/". str_replace('_', '-', $child_type),
             'query' => "parent=". $node->book['mlid'].$gidpath,
            );
          }

Comments

captaindav’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)