I'm using organic groups to manage access to projects. I've created a project (support) as a group and given membership to a user. But when they try to access the URL below to create an issue (from the Group Details block), they get an error:

Invalid project selected.
Access denied

If I try the same steps as admin, I can view the page but it forces me to select a project. So something is amiss.

The (internal) URL the user clicks in the group detail box is:

http://localhost/site/node/add/project_issue?gids[]=1

The URL of the resulting page showing the error is:

http://localhost/site/node/add/project-issue

The URL the admin is shown after clicking the link to create an issue AND after selecting a project is:

http://localhost/site/node/add/project-issue/support

I hope that makes sense.

Thanks

Comments

stodge’s picture

Or is this a potential problem in the project_issue module?

stodge’s picture

Debugged a bit. In og_determine_context() in og.module, $_REQUEST['gids'] is blank when creating an issue using the "Create issue" link in the Group Details block. When creating a blog entry through this block the gid is correctly set. Any ideas?

stodge’s picture

Edit: sorry, redundant info.

stodge’s picture

Damn, found this:

http://drupal.org/project/og_project

"llows the Project issue tracking module to function properly on a site that has Organic groups enabled. Without this module, the issue tracker does not work if you enable organic groups."

"When you click on the OG "add issue" link og_project should see the gids[]= in the URL and use that for the project and, vice versa, Project links to node/add/project-issue/{project-name} should prepopulate the OG audience"

So currently the group details block is broken or something is broken in OG related to project issues?

Thanks

sly5’s picture

I created a duplicate (not for the gids[] issue, but for the access denied issue) over at the project_issue issues: http://drupal.org/node/460002

For the gids[] issue, I use the following fix:


// Implement hook_og_links_alter
function mydirtyfixes_og_links_alter(&$links, $node)
{
   // If your group node is not a Project node, then associate a project with the group via CCK, say:   
   $pid = $node->field_project_node[0]['nid'];
   // Then edit the link to take you directly to the issue-add link, skipping project selection: 
  $links['create_project_issue'] = l(t('Create Issue'), "node/add/project-issue/$pid",
                                       array("query"=>array("gids[]"=>"$node->nid"))
                                         );
}

not ideal, but worx for me.

sly

dww’s picture

Project: Organic Groups » OG Project
Version: 6.x-1.3 » 6.x-1.x-dev
Component: og.module » User interface
Status: Active » Closed (duplicate)