Closed (fixed)
Project:
OG Join Role
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2010 at 09:14 UTC
Updated:
5 Aug 2010 at 10:32 UTC
Hi
I'm currently building a online course-system for my school and need to restrict the join-permission to specific roles.
Bug:
If a user clicks on the "join" link he gets to a white page and cant enter the group. The Log says following:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'og_subscribe' was given in /home/fzvr/domains/kurse.fzvr.net/public_html/includes/menu.inc on line 348.
If I disable the og_joinrole-module the problem disappears. Its really annoying and I really need this module. Please give me some advice how to fix that! Thank you
System:
Drupal: 6.16
OG: 6.x-2.0
og_joinrole: 6.x-1.x-dev
Notifications: 6.x-2.2
and some other modules
Comments
Comment #1
ultimikeThanks for the heads-up. It's been awhile since I've looked at the module, and some recent changes to OG caused the module to break. No worries, though - the fix is quite easy.
I'm currently having trouble with CVS, but the fix involves updating og_joinrole.module's hook_menu function as follows:
As soon as I get my CVS issue worked out, I'll commit the change.
-mike
Comment #2
ebs84 commentedThanks it work for me!
Comment #4
gorgo commentedThis fix isn't working for me...
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'og_subscribe' was given
Comment #5
trespass71 commentedI'm in the same boat as gorgo - there's nothing to fix and I have the same error message. It happens with a white screen both when attempting to join a group and also when attempting to invite a user.
Comment #6
ultimikeGorgo and trespass71 - please confirm you changed the code as outlined in comment #1 above and cleared all caches.
Thanks,
-mike
Comment #7
trespass71 commentedI'm sure I did. Just for you, though, I went back in and did it again. The error message is the same after I backtrack away from the plain white screen:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'og_subscribe' was given in /home/ ... /menu.inc on line 348.
EDIT: With inviting a friend, I get this warning instead:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'og_invite_form' was given in /home/ ... /form.inc on line 372.
Comment #8
ultimikeI just tested the module and wasn't able to reproduce the errors you listed above.
I did, however, get my CVS stuff straightened out, so I went ahead and committed the new version of the og_joinrole.module file here.
I would recommend grabbing a copy from here: http://drupalcode.org/viewvc/drupal/contributions/modules/og_joinrole/ (or wait a few hours until a new dev version is automatically generated) and give it another try.
If it still doesn't work, contact me via my contact page with a URL where I can check things out on your site.
Thanks,
-mike
Comment #9
gorgo commentedHi Mike,
Sorry to say the error is still there for me...
"warning: call_user_func_array() [function.call-user-func-array]:...."
Comment #10
ultimikeAre you using Organic Groups 6.x-1.x or 6.x-2.x?
OG Join Role requires 6.x-2.x...
-mike
Comment #11
gorgo commentedyep
using 6.x-2.1
-Guy
Comment #12
ultimikeAh - I think I just found and fixed it. Turns out it was a pretty easy fix. I just committed it, so it'll show up in the -dev version as soon as the Drupal.org packaging script gets to it (within the next 12 hours). If you want it sooner, you'll have to grab it from the CVS.
Please confirm the fix, then close this issue.
Thanks,
-mike
Comment #13
jenna.tollersonI might be crazy but it looks like the Drupal.org packaging script got to the 5.x version and not the 6.x version.
I am still getting the error with the latest 6.x-1.x-dev.
P.S. When I grab the latest from CVS the problem definitely resolves (yay!)
http://drupalcode.org/viewvc/drupal/contributions/modules/og_joinrole/og...
Comment #14
ultimikeYes, clearly my lack of CVS skills are on full display.
I just made a change to the 6.x release - I'm hoping that will fix the problem. In the meantime, the version from CVS is the latest.
-mike
Comment #15
gorgo commentedYeah it's working for me now too!
I was wondering if there is a way to add an option so that instead of GRANTING permission to join groups, you disable roles from joining groups.
Basically all authenticated users can join any group and I have a role for group admins. I want to block group admins from joining other groups.
Because Group Admins are also Authenticated Users, if I allow authenticated users to join groups, even if the box is unchecked for group admins, they can still join...
any advice?
Thank you!
-Guy
Comment #16
ultimikeGuy,
I'm not sure that what you're describing is possible - even if it is, it is probably not the best way to go.
I would suggest adding a new role that allows users to join groups and giving all your "authorized users" this new role by default (I believe there are a number of modules that allow you to assign roles automatically). Then you can not give this role to your Group Admin users.
At least that's what I would do...
-mike
Comment #17
gorgo commentedThanks for the advice, Mike.
I know it's dumb but for some reason I don't like creating "general" roles. I can't even explain why, I just have a gut feeling that if I do that I'm gonna find out! :)
To be honest (I think I mentioned that before) the only reason why I wanted to prevent group managers from joining other groups is because I'm also using U Create module and I didn't want group admins to have the ability to add users to groups they don't manage.
It's been a while since I posted this topic and I was very new to drupal. I gained some experience now and decided to take a look at the code for the ucreate module again and to my surprise, it took about 5 minutes to find the piece of code I needed to modify to fix it, so now I don't really need to prevent group managers from joining other groups at all!
I really appreciate your help though. So glad I got into Drupal! LOL
All the best,
Guy.
Comment #18
ultimikeNo worries. Glad it worked out!
-mike
Comment #19
ultimikeClosing.
-mike