Can a subgroup of a public group be private and hidden?

I’m building my first Drupal Organic Groups site, and running into problems.

Problem:

My goal is to have top-level Groups that are visible to the public, but only members can participate in them. There will be public subgroups too. Additionally, there must be invisible private groups that only members can see. All non-members, even logged-in site users, should not even see the group exists.

Since OG doesn’t support sub-groups in the core and the OG subgroups module is an alpha release, I tried making my own sub-group solution. (see description below)

A browser session not logged into the site does not show the private subgroup, as needed. However, a logged in user who is not a member of the group can see, not only the group name, but the member list and description (body field). The content is successfully hidden, stating "There is no content in this group."

Does OG support what I am trying to accomplish?

I have read these and other pages:

My configuration matches what is shown on those two references. (See screen captures below)

System and method description:

Fresh install of Drupal 7.26 and OG 7.x-2.5.

I created a new content type called "Subgroup" and assigned it all the OG fields (group_access, og_roles_permissions, group_register, group_content_access, group_theme), and marked both "Group" and "Group Content" in the Organic Groups tab in the Content Type creation form. The Subgroup content type also has an Entity Reference field type named "Parent Group." That is set to Target type "node"; Entity Selection -> Mode = Organic Groups; Target Bundles = Group; no sorting; OG membership type = default. "OG behavior" is checked under "Additional Behaviors.

To test, I created a Subgroup node titled "Drupal theming (PRIVATE)", with both Group Visibility and Group Content Visibility set to "Private – accessible only to group members". Other OG settings were: "Override default roles and permissions" (since my site OG default is to be public) and "Do not show on registration page." The site is using the default OG Node template panel for Groups.

I verified that the "non-member" role of the private subgroup has no permissions boxes checked in Subgroup > Group tab > Permissions panel.

In case it may be a clue, whenever I try to save an update to a Subgroup content type node, the system displays this error:

Notice: Undefined index: field_mode in OgBehaviorHandler->validate() (line 254 of /my/domain/path/sites/all/modules/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php).

private subgroup problem

Subgroup params

Content type OG settings

Sponsored by SupremePR
This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Can a subgroup of a public group be private and hidden?

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.