Hello

in Available Groups the "Open or Closed Groups" is empty.

However i really created groups. How can i make them appear in the list ?

regards

Raphaël

Comments

Jackinloadup’s picture

Same problem here.

I also got this error:

user warning: Unknown column 'o.selective' in 'where clause' query: SELECT n.nid, n.title, o.* FROM node n INNER JOIN og o ON n.nid = o.nid WHERE (o.selective = 3 OR o.selective = 0) ORDER BY n.title in ~SITEPATH~/httpdocs/sites/all/modules/og_multiple_mandatory_groups_by_role/og_multiple_mandatory_groups_by_role.module on line 645.

EDIT:
Also just to be clear. I have an open group and a closed group. So i know that is not the issue.

Jackinloadup’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.25 KB

Ok so i tracked down the problem. Im not sure if this was caused by a OG update or not but I am currently using Organic groups 6.x-1.3.

This is the first time i have submitted a patch so i hope it works. Looks like it will though.

ashledombos’s picture

it worked for me :) thanks !

Steve Dondley’s picture

Status: Needs review » Reviewed & tested by the community

Fixed the problem.

BetaTheta’s picture

This may seem like a silly question, but how do I patch the module?

Jackinloadup’s picture

http://drupal.org/patch/apply
Read this for a definitive answer.

place the patch in the root directory of the module.
sites/all/modules/og_multiple_mandatory_groups_by_role/og_multiple_mandatory_groups_by_role.patch

then cd into that directory in terminal and to this patch -p0 < og_multiple_mandatory_groups_by_role.patch

TaDa!

inforeto’s picture

patch worked, thanks

mirabuck’s picture

The patch worked for me as well. Many thanks.

johnhanley’s picture

Ditto on the patch working correctly. Kudos to jackinloadup.

It's hard to believe the last release for this module was well over a year ago. How could something this fatal be allowed to persist for that long? Has the maintainer abandoned the project?

tsaker’s picture

After applying the two aforementioned fixes, modifying the code at line 646 as follows will fix the empty group list issue as well:

    $option_result = db_query("SELECT n.nid, n.title, o.* FROM {node} n INNER JOIN {og} o ON n.nid = o.nid WHERE (o.og_selective = %d OR o.og_selective = %d) ORDER BY n.title", OG_CLOSED, OG_OPEN);
    if( db_affected_rows($option_result) <= 0 ) {
        $options = array( "" => "(no groups enabled)" );
    }
    else {
        while ($group = db_fetch_object($option_result)) {
          $options[$group->nid] = $group->title;
          switch ($group->og_selective) {
            case OG_OPEN:
              $options[$group->nid] .= ' | ' .t('Open group, users can unsubscribe.');
              break;
            case OG_CLOSED:
              $options[$group->nid] .= ' | ' .t('Closed group, users can not leave.');
              break;
          }
        }
    }
tsaker’s picture

OK - I fixed the delete issues as well. As far as I can tell all problems are resolved if you apply the following patch. See #6 for instructions and substitute this patch file:

tsaker’s picture

Some final cosmetic changes ...

- User and group names are reported instead of their ID's when applying changes.
- The menu tab order was rearranged to make better sense. This change may require you to perform a page cache flush.

This following patch file is comprehensive and was developed against release 6.x-1.3:

niallhatton’s picture

When trying to apply the patch I get this:-

Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- og_multiple_mandatory_groups_by_role.module 2009-09-14 12:04:29.2579
43800 -0400
|+++ og_multiple_mandatory_groups_by_role.20090915.module 2009-09-14 17:38
:18.133622100 -0400
--------------------------
Patching file og_multiple_mandatory_groups_by_role.module using Plan A...
Hunk #1 succeeded at 65.
Hunk #2 succeeded at 75.
Hunk #3 succeeded at 97.
Hunk #4 succeeded at 108.
Hunk #5 succeeded at 117.
Hunk #6 succeeded at 126.
Hunk #7 succeeded at 144.
Hunk #8 succeeded at 495.
Hunk #9 succeeded at 528.
Hunk #10 succeeded at 604.
Hunk #11 succeeded at 640.
Hunk #12 FAILED at 655.
Hunk #13 succeeded at 765.
Hunk #14 succeeded at 813.
Hunk #15 succeeded at 858.
1 out of 15 hunks FAILED -- saving rejects to file og_multiple_mandatory_groups_
by_role.module.rej
done

Anyone have any ideas?

tobias’s picture

Hi Nialhatton -

I had the same thing happen to me when I only applied the latest patch (#12).. when I tried again and applied first the patch in #2 and then the #12 patch, it worked.

This module provides important functionality for me - many thanks to the original developers. I hope it gets picked up again and these improvements are in a future release.

-T

petednz’s picture

kudos to the developer and the patch makers - installed and applied patch in #2 and #12 as suggested in #14 and yay all seems good.

so finally have a way of getting anybody who is given a particular role to be added to a particular group - cuts out a whole step when we want to add users to a particular OG that is private and hence not on the 'add user' screen.

bryancasler’s picture

In case anyone else in here is like me and can't patch on windows to save their lives, I went ahead and did path #2 and then patch #12 for you (see attached) and everything seems to be working fine on my end. **Just remove the .patch extension**

bryancasler’s picture

After applying these patches I am now running into the problem that the only groups listed are the "Open" ones, and my "Moderated", "Invite Only" and "Closed" groups are not showing up. I've started a new issue que here to work on this if anyone is interested.

rconstantine’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

This patch was the same as another.