Hello
The API changed for OG 2.
So the og_webform should also change.

I made some changes that work in my case, but I haven't tested it thoroughly.
I just thought I would share for other users of this module.

Comments

bircher’s picture

StatusFileSize
new5.12 KB

and here is the patch

jastraat’s picture

Status: Active » Needs review
StatusFileSize
new6.54 KB

I'm afraid the previous patch doesn't take into account that a webform could be in multiple groups and that the entity reference field could be named something other than the default. I've attached an alternate patch that should work for more use cases.

Renee S’s picture

Patch didn't apply cleanly, but a bit of copy-pasting and #2 works great for me.

jastraat’s picture

StatusFileSize
new6.54 KB

There were a few excess spaces in the patch, so I've attached a slight update. I just tried applying it again though, and it applied cleanly. Just to double-check, did you try to apply it against the latest dev (not the latest release)?

sheldonkreger’s picture

Status: Needs review » Needs work

I don't see a dev branch for this project. But, the patch in 4 does not apply cleanly to 7.x-1.0-beta1

I will take a look at this patch and see if I can get it to apply cleanly to the current release.

sheldonkreger’s picture

Just a quick update:

Patch in 4 applies cleanly when you also include this commit "http://drupalcode.org/project/og_webform.git/commit/b60f03a"

I'm going to test the actual functionality later on today.

jastraat’s picture

I cloned the dev branch directly from git.

jastraat’s picture

Status: Needs work » Needs review
alison’s picture

Patch applied cleanly for me when I included the commit mentioned in #6. I'm running OG 7.x-2.2.

oranges13’s picture

Patch worked for me!

jastraat’s picture

Status: Needs review » Reviewed & tested by the community
pgillis’s picture

Patch works for me. Are there any plans for a new release? From my understanding OG is only supported on 2.0 now.

Renee S’s picture

I'm using this in production with OG2 and it works great. A++ would patch again. Can we get it committed? OG2 is the official release now and is bundled with things like Atrium and Commons.

bircher’s picture

Thanks to jastraat!
Indeed, I forgot to consider these cases.

I concur with Renee S.

anthonyroundtree’s picture

The patch seems to work for me, but only with the commit from #6.

kunkunkun’s picture

Issue summary: View changes

Do I need to add a group reference in the webform to make this work?

Renee S’s picture

Yes, you do :)

(eta: on the Webform node, that is.)

uzuri’s picture

I tried the patch (+ commit from 6) this morning with no luck, running OG 2.7. Only way I could get my lower-access user to be able to see webform results was to grant the overreaching permission to see all webform results on the entire site, regardless of group (or see only your own form's results, though that's a useless option when you've got multiple people who want a shot at the result set). Tweaking with the group-level settings for results does nothing.

We're not going to allow free webform creation on our site just yet, so I've got a bit of a workaround for the single form that's critical, but it'd be nice to have this working.

Edit: I was wrong -- it works! Managed to overlook one little checkbox on my test user.

joshuautley’s picture

I can confirm the latest dev + #6 patch works. Note that if you use the latest dev release you do not need patch#4 as its included.

Running Drupal 7.34 and OG 7.x-2.7

ladew222’s picture

I attempted patch #6 with OG 7.x-2.7 to no avail. I have given the test user permissions to access all webform data through the group permission page but they do not see the results tab unless I grant them global permissions to view webform results. Do I need to include #4 or is there another config option I missing...

oranges13’s picture

From comment #6:

Patch in 4 applies cleanly when you also include this commit

You need to apply both the patch in #4 and the code you applied in #6

ladew222’s picture

Ok thanks..

ladew222’s picture

StatusFileSize
new8.18 KB

I checked and both were applied. I will paste the relevant sections of og_webform.module. I also joshuautley suggested used the latest dev version. Could that be a problem?

Implements hook_webform_submission_access().
*
* @see webform_submission_access()
*/
function og_webform_webform_submission_access($node, $submission, $op = 'view', $account = NULL) {
global $user;
$account = isset($account) ? $account : $user;

// Ensure a full node object, as Views handlers may not load the entire node.
if (empty($node->vid) && !empty($node->nid)) {
$node = node_load($node->nid);
}
// Ensure a full node object, as Views handlers may not load the entire node
if (empty($node->vid) && !empty($node->nid)) {
$node = node_load($node->nid);
}
// If this webform is not in a group, don't affect access.
if (empty($node->group_audience['und'])) {
return;
}

ladew222’s picture

I am looking into my problem. Oranges13 I believe is right as I do not think patch #4 is included.

ladew222’s picture

Thanks Oranges13, the stable release and the two patches worked.

btmash’s picture

Can confirm that patch #4 with the dev release applies cleanly.

oriol_e9g’s picture

StatusFileSize
new1.93 KB

I can also confirm that patch #4 + patch #6 + OG-2.7 Works.

Attaching the patched module for easy use/test.

zeip’s picture

Priority: Normal » Major

The patch in #4 worked for me, thanks! Maybe this could finally be committed and released as a new version? Escalating the issue to priority Major, since this renders the module useless for users of new OG and the OG version restriction isn't mentioned on the module page.

abu-zakham’s picture

I can also confirm that patch #4 + patch #6 + OG-2.8 Works.

anewholm’s picture

thanks!

robcarr’s picture

StatusFileSize
new6.65 KB

Just re-rolled the patch for OG2 against the current Beta1 release. Seems to work with OG2.9. Thanks to jastraat and sheldonkreger for the code.

carlovdb’s picture

#27 did the job for me!!

jeffm2001’s picture

To clarify, for others like me who were confused reading this thread, what you need is 7.x-1.x-dev + the patch in #4.

It would be nice if the patch was committed, but seeing as it's almost 5 years old at this point, it probably never will be.

cortlandd’s picture

#31 resolves the issue for version: 7.x-1.0-beta1