I have og_userroles restricting the content that a user can post to a particular group. I'd like to create a pageroute to create content types just within that organic group. However, pageroute appears to lose the group context and so the content types are not allowed. How can I keep pageroute in the group context to allow the user to create the content?

Thanks, Stephen

CommentFileSizeAuthor
#3 og_aware.patch1.11 KBpbarnett

Comments

scedwar’s picture

Title: OG user group content types » Pageroute create og content - loses og context

bit of bump but also wondering if anyone else would be interested in sponsoring this feature?

scedwar’s picture

we're working on a patch for this and have it working such that you create a group in the pageroute and subsequent node adds within the same pageroute use the group context. Patch coming soon.

pbarnett’s picture

Assigned: Unassigned » pbarnett
Status: Active » Needs review
StatusFileSize
new1.11 KB

And here it is, rolled for 5.x-1.0 after some frantic modification; the original was against a dev version that preserved the nid of the first node created throughout the route in the URL; this version checks for the previous node being a either a group homepage or a group member.

Not perfect, but better...

Sponsored by Charity Rallies (http://charityrallies.org)

fago’s picture

Category: support » bug
Status: Needs review » Needs work

* Please roll patches always against the latest dev snapshot
* Isn't that solvable by setting the group context of og? og_set_group_context() ?

paullwolborsky’s picture

Fago,

Can you elaborate on what to do with og_set_group_context()? If you can provide us with code snippets and filenames (whether in-module or via hook), this would be extremely useful.

A quick reply would be even better.

I am putting together a sophisticated, and complex environmentally-friendly construction materials product registry, with a Nov 1st deadline. Pageroute is exactly what I need for a complicated form, but I cannot use it because the site is built upon OG.

Thanks!

PW - spent at least 100 hours quality time with Drupal. My girlfriend suspects an affair.