Hello, wunderful to see a first solution for og forums here!

Futur :
Currently, there is no forum administration inside the groups. The Organic group forums are managed just like any other forums.
In the futur, i planned to create an internal forum administration for each Organic group and to add some privileges to administer the forum inside an organic group.

Do you plan:
1) admin/ moderation permissions for group admin or maybe a group moderator role?
2) add/ remove (group) forums inside an og forum container?

Any progress until today with new features?

Thanks for your work and first official release!

Comments

epieddy’s picture

Hi,

Currently the moderation permission is manageable inside an OG with Forum Access :

OG Forum D7 add a new OG permission called Moderate the forum.
Any member of an OG with the permission Moderate the forum will be declared as a moderator inside Forum Access for every forum inside the group.

What is missing is an administration inside the OG to manage only the group's forums. Currently, the only way to add a sub forum for an OG is with the global forum administration.

I have not started to dev this feature yet.

Hope i answered your question.

JohnnyX’s picture

Currently the moderation permission is manageable inside an OG with Forum Access :

OG Forum D7 add a new OG permission called Moderate the forum.
Any member of an OG with the permission Moderate the forum will be declared as a moderator inside Forum Access for every forum inside the group.

Great job!

What is missing is an administration inside the OG to manage only the group's forums. Currently, the only way to add a sub forum for an OG is with the global forum administration.

I have not started to dev this feature yet.

Would be a great additional feature and I would love to see it integrated here!

Thanks for answering my questions!

bluecobalt’s picture

Thanks for this module epieddy. We really needed this. The forum admin inside OG would make our needs complete!

epieddy’s picture

Status: Active » Postponed
epieddy’s picture

Issue summary: View changes

Thanks added...

jojonaloha’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Postponed » Needs review
StatusFileSize
new21.02 KB

This is an initial patch that adds some forum administration pages for the group.

Overview of Changes

The patch:

  • adds an administer forums OG permission
  • automatically creates a "root" forum container for the group when it is created
  • adds OG forum admin pages when the OG UI module is enabled at: group/%/%/admin/forums

The patch assumes that each Group will have it's own forum container with no other parent container, and that all the sub-forums of that container will belong to the group. The new pages try to re-use as much code from the forum and taxonomy modules as possible, but the forum list og_forum_overview() is largely a copy of taxonomy_overview_terms() because we need to call taxonomy_get_tree() and pass in the Groups root term.

Still Needs Work

The assumptions made by the patch currently may not always be true.

  • Currently a site admin can create new sub-forums or change the group of sub-forums from the admin/structure/forum or admin/structure/taxonomy/forums pages. We could add our own validation functions to these pages to prevent that.
  • Currently there is no update script for existing Groups.
  • Also we should handle creating/setting the root forum for Groups when the module is (re)enabled.

Hoping to get some feedback of the work done so far and/or thoughts on what still needs work.

jojonaloha’s picture

StatusFileSize
new21.23 KB
new1.38 KB

Attached patch fixes the edit forum and edit container links not showing up on these new pages.

jojonaloha’s picture

Attached patch fixes an issue creating forum containers from these new pages.

jojonaloha’s picture

Updates to add the ability to move forum topics when a forum is being deleted. This is related core issue #206820: Relocate or delete topics on forum deletion to avoid leaving stale data in database.

jojonaloha’s picture

Updated patch based on changes to the core patch in #206820: Relocate or delete topics on forum deletion to avoid leaving stale data in database.. Also does some cleanup and reduces some of the duplicate code from the core patch.

vegantriathlete’s picture

I'll probably also have to sort things out on account of #1844104: non-group-member can post in private forum being applied.

aliciagh’s picture

Great job!
Thanks!!

aliciagh’s picture

Hi,

I've updated the patch in order to include:

  • Change the group of root container can do it from the admin/structure/forum or admin/structure/taxonomy/forums pages.
  • If a site admin delete the root container through the admin/structure/forum or admin/structure/taxonomy/forums pages, there is no conflicts with the OG forum admin page.
  • When a group is deleted, the root container, sub-forums and all associated topics are delated too.
  • New elements in the breadcrumb of the OG forum admin page in order to have acccess to the group admin page and to the group page.

I'm working in the update script but I don't find a good solution to this problem.

Thanks for your patch @jojonaloha.

vegantriathlete’s picture

Thanks @aliciagh for working on this. My client has pulled me on to other priorities for the moment. I will be returning to this in the near future and will have a look at what you've got here. Just know that I'll be patching dev (to roll the next release) with the work I did in #1844104: non-group-member can post in private forum and #2416671: Don't just blindly hide the Group Audience and Content Visibility fields. So it would be great for you to apply those patches to see how they work and to be sure that your patch applies on top of them.

R.Muilwijk’s picture

Patch didn't apply anymore.

vegantriathlete’s picture

@R.Muilwijk Thanks for rolling a new patch. At the moment, I don't think -dev is in very good shape and it's likely to change. So your patch may not end up applying, either.

Hold off on doing anything more with this patch until I've cleaned up -dev and rolled a new stable release.

vegantriathlete’s picture

I'm back and this will be one of the first issues I will be looking into. Let me see if I need to reroll the patch and what the patch does.

vegantriathlete’s picture

Assigned: Unassigned » vegantriathlete
vegantriathlete’s picture

  1. +++ b/og_forum.module
    @@ -216,6 +216,207 @@ function og_forum_comment_view($comment, $view_mode, $langcode) {
    +    variable_set('forum_containers', $containers);
    

    Let's make sure that this variable is removed when the module is uninstalled.

  2. +++ b/og_forum.module
    @@ -216,6 +216,207 @@ function og_forum_comment_view($comment, $view_mode, $langcode) {
    +    variable_set('og_forum_containers', $group_containers);
    

    Let's make sure that this variable is removed when the module is uninstalled.

  3. +++ b/og_forum.module
    @@ -216,6 +216,207 @@ function og_forum_comment_view($comment, $view_mode, $langcode) {
    +    } while ($term = next($tree));
    

    Is this according to Drupal's coding standard?

  4. +++ b/og_forum.module
    @@ -216,6 +216,207 @@ function og_forum_comment_view($comment, $view_mode, $langcode) {
    +      watchdog("og_forum", $old_gid." ".$new_gid, array());
    

    This is definitely not following Drupal coding standards with the concatenation

  5. +++ b/og_forum.module
    @@ -489,3 +717,32 @@ function og_forum_permission() {
    +    $current_key=$key;
    

    Drupal coding standard issue

  6. +++ b/og_forum.module
    @@ -489,3 +717,32 @@ function og_forum_permission() {
    +    if($needle===$value || (is_array($value) && _og_forum_recursive_array_search($needle,$value) !== false)) {
    

    Drupal coding standard issue

  7. +++ b/og_forum.pages.inc
    @@ -0,0 +1,440 @@
    +  $breadcrumb[] = l($group->title, 'node/'.$gid);
    

    Can you assume it's a node?

  8. +++ b/og_forum.pages.inc
    @@ -0,0 +1,440 @@
    +  $breadcrumb[] = l(t('Group'), 'node/'.$gid.'/group');
    

    Can you assume it's a node?

  9. +++ b/og_forum.pages.inc
    @@ -0,0 +1,440 @@
    +  } while ($term = next($tree));
    

    Is this following Drupal coding standards?

  10. +++ b/og_forum.pages.inc
    @@ -0,0 +1,440 @@
    +/**
    + * Page callback: forum add/edit page.
    + *
    + * @param $type
    + *   What is being added. Possible values are 'forum' and 'container'.
    + * @param $term
    + *   (optional) A forum term object to be edited.
    

    There are two more parameters to document

vegantriathlete’s picture

+++ b/og_forum.module
@@ -232,7 +433,11 @@ function og_forum_og_default_roles() {
+    'administer forums' => array(

The Forum module already defines this permission. Was this an intentional duplication?

I'm thinking it should be called 'administer og forums'

vegantriathlete’s picture

StatusFileSize
new59.72 KB

I'm going to be taking notes as I make my way through testing this patch for basic functionality. I'm signed in as UID 1 for this initial pass.

First note: I see the new permission for the OG (screen shot attached).

vegantriathlete’s picture

StatusFileSize
new42.98 KB

Second note: I see the Forums link on the Group tab (screen shot attached)

vegantriathlete’s picture

I'm getting error notices

Notice: Undefined index: #page_increment in theme_taxonomy_overview_terms() (line 551 of /var/www/public_html/ogforums/modules/taxonomy/taxonomy.admin.inc).
Notice: Undefined index: #page_entries in theme_taxonomy_overview_terms() (line 552 of /var/www/public_html/ogforums/modules/taxonomy/taxonomy.admin.inc).
Notice: Undefined index: #back_step in theme_taxonomy_overview_terms() (line 553 of /var/www/public_html/ogforums/modules/taxonomy/taxonomy.admin.inc).
Notice: Undefined index: #forward_step in theme_taxonomy_overview_terms() (line 554 of /var/www/public_html/ogforums/modules/taxonomy/taxonomy.admin.inc).
Notice: Undefined index: #parent_fields in theme_taxonomy_overview_terms() (line 557 of /var/www/public_html/ogforums/modules/taxonomy/taxonomy.admin.inc).

Steps to reproduce:
1) View an OG
2) Click the Group tab
3) Click the Forums link
4) Navigate to another page

Note: The OG does have forums assigned to it

vegantriathlete’s picture

If I go to admin/structure/forum I can see that I've got containers and forums assigned to the OG.

The forum administration page is not pulling in existing containers and forums. I suspect it's because the variable has not been initialized. Why are we using variable_get and variable_set? Is admin/structure/forum using them?