On user/register I get two of these:

    * warning: array_keys() [function.array-keys]: The first argument should be an array in C:\xampplite\htdocs\drupal-4-7\modules\og_mandatory_group\og_mandatory_group.module on line 31.

I have created a closed OG called "Public" and under admin/settings/og have specified that to be the mandatory group. Other than enabling OG access control, I've made no other changes to a fresh Drupal 4.7 install + OG + og_basic + OG Mandatory group.

Comments

webchick’s picture

I see. When I check the "registration form" checkbox on the group, then it appears as a greyed-out checkbox and the error goes away.

Seems like it should be optional to show the group on the registration form or not, however.

pwolanin’s picture

Yes, it should be optional. I added the "grayed-out" feature recently, so maybe I missed something when testing the code.

pwolanin’s picture

StatusFileSize
new1.11 KB

@webchick - a quick look at the code suggests that the problem occurs when there are zero groups in the registration form.

A patch is attached, which checks for this condition before checking whether the mandatory group is in the form.

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

@webchick - a quick look at the code suggests that the problem occurs when there are zero groups in the registration form.

A patch is attached, which checks for this condition before checking whether the mandatory group is in the form.

pwolanin’s picture

StatusFileSize
new895 bytes

I think the attached patch is better

pwolanin’s picture

StatusFileSize
new1.89 KB

better still - improves selection of the message for the registration form as well.

pwolanin’s picture

Assigned: Unassigned » pwolanin
Status: Needs review » Fixed

commited changes to 4.7 and HEAD

Anonymous’s picture

Status: Fixed » Closed (fixed)