Closed (fixed)
Project:
Organic Groups Mass Add
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Feb 2013 at 14:36 UTC
Updated:
23 May 2014 at 17:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dan2k3k4 commentedThis occurs on the current dev release as well.
Comment #2
dan2k3k4 commentedFrom the issue posted on OG, this occurs for other OG sub-modules so I assume something changed in OG that the sub-modules haven't updated yet ?
Comment #3
nubeli commentedThe issue is centered on the hooks defined in og_ui.api.php. When the hooks are used without checks for whether the content type is a group they add the group tab to every content type.
In og_massadd.module I commented out the function og_massadd_og_ui_get_group_admin_alter() which eliminates the group tab issue. But that also removes any link to the new functionality so I also added og_massadd_og_ui_get_group_admin so links are added to the group admin tab. I borrowed from og_ui_og_ui_get_group_admin where before adding the links it runs og_user_access which returns NULL if it's not a group and FALSE if the user doesn't have access.
So that allows there to be links but doesn't add group tabs on every content type. Make sure to clear the cache if you update the module.
I haven't tried to figure out how to use og_massadd_og_ui_get_group_admin_alter() if that is needed. I'd welcome suggestions. Perhaps this code enough to make a patch.
Comment #4
jaxtheking commentedI realised I had the same issue when the "Administer Group" tab appeared for all users, even the ones that did not have any admin rights. Though the tab was an empty page and therefore not a security threat. But still... The below code should fix the issue.
I am not setup to create a patch now, but hopefully the module maintainer can test/add this easy fix.
At line 95 of og_massadd.module, replace the og_massadd_og_ui_get_group_admin_alter function with this:
Basically, this hijacks the add people link only when it exists.
Comment #5
fuzzy76 commentedHoping hernani can take a look at this? Our D7 platform won't be using Organic Groups, but multisite instead.
Comment #6
wadmiraal commentedTurned #3 into a patch.
Comment #7
namita21 commentedUsed #3 for removing group tab from all content type but that made Add people to go to default page not to the Group MassAdd page so added a condition mentioned in #4. All worked well.
Thanks for the help.
Comment #8
alvar0hurtad0Patch applyes and works fine.
Commited to dev version.
Comment #9
alvar0hurtad0