Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Organic Groups and adding notes #45

Open
olafgrabienski opened this issue Mar 3, 2022 · 29 comments
Open

Testing Organic Groups and adding notes #45

olafgrabienski opened this issue Mar 3, 2022 · 29 comments
Assignees

Comments

@olafgrabienski
Copy link
Member

olafgrabienski commented Mar 3, 2022

I'm follwing the Drupal 7 tutorial from https://modulesunraveled.com/organic-groups-7x-2x to test Organic Groups. I'll add more comments to report how the module works in Backdrop.

Table of content

  1. Introduction
  2. Organic Groups Setup
  3. Organic Groups Views
  4. Organic Groups Layout
  5. Configuring Content Types for group "Content create links"
  6. Creating Private Groups
  7. Working with Content in Public and Private Groups
  8. Advanced Private Groups
  9. Advanced Public Groups
  10. Organic Groups Memberships
  11. Global OG Group Permissions
  12. Organic Groups Global Roles
  13. Global OG Group Content Permissions
  14. Group Specific Roles
  15. Group Specific Permissions
  16. Organic Groups Settings
  17. Organic Groups Field Access
  18. Adding Additional Group Types
@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

1. Introduction

From https://modulesunraveled.com/organic-groups-7x-2x/introduction for Drupal 7:

In this series, I'll walk you through the 7.x-2.x version of Organic Groups. This module lets you create groups. A group is simply a collection of content or people. Groups have three basic components:

Group type
Group members
Group content

Group type denotes which pieces of content should be handled as groups. I'll show you how to create a group content type in Video 1 - Organic Groups Setup.

A group can have one or more associated users, either by subscribing to the group or having been assigned to the group. We’ll refer to these users as the group members, and we'll be talking more about group membership in Video 9: Organic Groups Membership.

The last component is group content. This refers to the articles or other content types that are posted in the group. We’ll take our first look at how to add content to our groups in Video 4 - Configuring Content Types for group “Content create links”.

We’ll also cover group roles, permissions, how to layout our groups using Panels and a whole lot more.

@olafgrabienski
Copy link
Member Author

2. Organic Groups setup

See https://modulesunraveled.com/organic-groups-7x-2x/organic-groups-setup.

Install Modules

  • Drupal:
    • Organic Groups
    • Entity API
    • Entity reference (Required by: Organic groups and Organic groups UI)
    • Ctools
    • Views
    • Views Bulk Operations (Required by: Organic groups UI)
  • Backdrop:
    • Organic Groups
    • Entity Plus
    • Entity UI
    • Entity Reference

Enable Modules

  • Backdrop:
    • Organic Groups
    • Organic Groups UI
    • Entity modules (see above)

Create Group Type (define a content type to be a group):

  • Add content type

    Notice: Undefined index: target_type in og_ui_form_node_type_form_submit() (line 992 of my-path/modules/og-1.x-2.x/og_ui/og_ui.module)
    Notice: Undefined index: target_bundles in og_ui_form_node_type_form_submit() (line 993 of my-path/modules/og-1.x-2.x/og_ui/og_ui.module)

  • Name: Group
  • Description: A group can be private or public and have its own set of roles and permissions.
  • Vertical tab Menu settings: Select "Primary navigation"
  • Vertical tab Organic groups: Select "Group"

Configure Group Content Type (configure the Post content type to to be group content):

  • Edit content type Post
  • Vertical tab Organic Group: Select "Group Content", Target type: Node, Target bundles: Group
    Target bundle not (visibly) saved, but OK on admin/structure/types/manage/post/fields/og_group_ref

Add content: Group 1

  • Title: Group 1
  • Body: Lorem ipsum text
  • Provide a menu link

Save and have a look at node tab "Group" (People etc.)

Add a Post to the Group

  • Title: Post A
  • Body: Lorem ipsum text
  • Groups audience: Group 1

Post has a reference link to Group 1. No mention of the post in the group, because group display hasn't been configured.

@olafgrabienski
Copy link
Member Author

3. Organic Groups Views

See https://modulesunraveled.com/organic-groups-7x-2x/organic-groups-views.

Enable Modules

  • Drupal:
    • Views Content Panes
    • Views UI
  • Backdrop:
    • Views Content Panes: not necessary
    • Views UI: enabled by default

Existing Views

  • OG all user group content
    Shows content from all groups the current user belongs to.
  • OG content
    Shows all content of a group.
  • OG members
    Lists the most recent members of the current group. Comes with a block display, and a Content pane (for Panels).
  • OG members admin
    The default view for the "People" tab in a group.
  • OG User groups
    A list of all the groups the logged in user is a member of.
  • (OG list)
    A list of groups. Only available in previous versions of OG. Created a custom view in Backdrop:

Create a View

  • View name: OG List
  • Show: Content of type Group
  • Create a page
  • Path: og-list
  • Display format: Table
  • Fields: Title, Body (Summary or Trimmed)
  • Page Settings: Select "No menu" to add a menu item
    • Type: Normal menu entry
    • Title: All Groups
    • Description: List of Groups
    • Menu: Primary navigation
  • Change sort criteria
    • Remove Post date
    • Add Title (asc)

Create a 2nd group, and visit the Views page.

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

4. Organic Groups Layout

See https://modulesunraveled.com/organic-groups-7x-2x/organic-groups-layout.

Install modules

  • Drupal:
    • Panels
    • Entityreference Prepopulate (for “Create content” links on group nodes to post automatically to this group)
  • Backdrop:
    • Panels: not necessary
    • Entityreference Prepopulate: not available. Alternatives:

Add Layout for Groups

  • Template: e.g. Moscone Flipped
  • Path: node/%
  • Visibility Condition: Node Type = Group

Add blocks to Layout

  • Field Body (or leave Main page content)
  • OG content create links via og_group_ref: not available (see next comment)
  • View OG content: block not available. Fix:
    • Create a block in the OG content view
      Important: Change the view's Block settings > Contextual filter input (data sources for contextual filters) > OG membership: Group ID source > From URL, URL position: 2 (for the node ID in node/NID)
      See issue Improve the "OG content" view #80.
  • View OG members
    Important: Change the view's Block settings (same as for View OG content, see above)
  • Field Group (group_group), formatter: OG subscribe link
    Consider to remove the field from the default display (admin/structure/types/manage/group/display/default).

Layout the panel

  • Drupal: Create regions and columns, then move blocks.
  • Backdrop: not necessary, blocks are already placed in the Layout

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

5. Configuring Content Types for group "Content create links"

See https://modulesunraveled.com/organic-groups-7x-2x/configuring-content-types-group-“content-create-links”.

  • Drupal: Configure the Field "Groups audience" of Articles with Entity Reference Prepopulate
  • Backdrop: Field "Groups audience" > Additional Behaviors > Entity Reference Prepopulate
    NB: by the time of writing the module isn't available for Backdrop
  • Temporary workaround for Backdrop:
    • Install the Prepopulate module.
    • Add a views block, content of type Group, Field: Nid, and rewrite the field to:
      <a href="/node/add/post?edit[og_group_ref][und][0][default]=[nid]" title="Add a post to this group">Add post</a>
    • Add a Contextual filter to the view: "Content: NID", Provide default value: "Content ID from URL".
    • Make the view (or the block) only available to people who should be able to use it.
    • Place the Views block in the sidebar of the Group layout.

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

6. Creating Private Groups

See https://modulesunraveled.com/organic-groups-7x-2x/creating-private-groups.

Enable module

  • Drupal:
    • Organic groups access control
      After enabling you see a message with a link to rebuild the content access permissions.
  • Backdrop:

Add OG field "Group visibility"

  • Configuration > Organic groups > OG field settings (admin/config/group/fields)
  • Bundles: Group
  • Fields: Group visibility
  • Add field

Optional: hide OG field on display (not covered in the video):

  • admin/structure/types/manage/group/display/default
  • Group visibility > Format: Hidden
  • Save

Create a private group

  • Content > Add content > Group (node/add/group)
  • Title: Group 2
  • Body: Lorem ipsum text
  • Group visibility: Private
  • Provide a menu link

Result: only members can see the private group and its menu link

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

7. Working with Content in Public and Private Groups

See https://modulesunraveled.com/organic-groups-7x-2x/working-content-public-and-private-groups.

Drupal:

If you would like to have all content posted to private groups be private, and all content posted to public groups be public, you don’t need to do anything further. That is how group content works by default (with one caveat).

  • Content posted to public groups is public
  • Content posted to private groups is private
  • Content posted to both public and private groups is only visible to members of one of the groups (private or public)

Backdrop:

  • Content posted to public groups is public
  • Content posted to private groups is private ... public (!) private
    edit 27 Apr: seems to be fixed in the meantime
  • Content posted to both public and private groups is only visible to members of one of the groups (private or public)

Note: on my test site, a post added to multiple groups appears multiple times in the "OG content" view. To display it only once, I have changed the view's "Query settings" to "Distinct". See issue #80.

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

8. Advanced Private Groups

See https://modulesunraveled.com/organic-groups-7x-2x/advanced-private-groups.

Add OG field "Groups content visibility"

  • Configuration > Organic Groups > OG Field Settings (admin/config/group/fields)
  • Bundles: Post
  • Fields: Group content visibility
  • Add field

Optional but recommended: hide OG field on display (not covered in the video):

  • admin/structure/types/manage/post/display/default
  • Group content visibility > Format: Hidden
  • Save

Create a private post

  • Add Content > Post
  • Title: Post E (in private group)
  • Body: (Lorem Ipsum)
  • Groups audience: Group 2 (private)
  • Group content visibility: Use group defaults
    post has same visibility as the group
    other options: Public / Private
  • Save

Create a public post in a private group

  • Add Content > Post
  • Title: Post F (public in private group)
  • Body: (Lorem Ipsum)
  • Groups audience: Group 2 (private)
  • Group content visibility: Public
    accessible to anyone, e.g. as promoted content on the Home page
  • Save

@olafgrabienski
Copy link
Member Author

9. Advanced Public Groups

tba

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

10. Organic Groups Memberships

See https://modulesunraveled.com/organic-groups-7x-2x/organic-groups-memberships.

Request Group Membership

  • Log in
  • Go to Group 1 (public)
  • Click the "Request group membership" link
  • optional: Write a request message
  • Join
    The Request link has changed to an Unsubscribe link, but the new member isn't listed in the Members block.
    Note: The tutorial claims that "the request has been sent to the group administrator". AFAIK this is not the case, unless you install and configure the Rules module.

Manage Membership

  • Go to Group 1 (public)
  • Click the "Group" tab
  • Click "People" to manage the members of the group

Modify group membership

  • Drupal:
    • Group 1 (public) > Group > People
    • Operations: Modify Membership Status
    • Select the checkbox next to the new member
    • Execute
    • State: Active
    • Next / Confirm
  • Backdrop:
    • Group 1 (public) > Group > People
    • Operations: not available
      (missing bulk operations at admin/structure/views/view/og_members_admin)
  • Workaround for Backdrop:
    • Click "edit" link next to the new member
    • Status: Active
    • Update membership
  • Further notes re Backdrop:
    • After editing, you are not redirected to the People page
    • Membership status is not reflected on Backdrop's User account page
    • Admins can update membership via the User account page (overwrites People page)

Remove membership

Block membership

  • Drupal:
    • Group 1 (public) > Group > People
    • Operations: Modify membership status
    • Select the checkbox next to the new member
    • Execute
    • State: Blocked
    • Next / Confirm
  • Backdrop:
    • Group 1 (public) > Group > People
    • Operations: not available
  • Workaround for Backdrop:
    • Click "edit" link next to the new member
    • Status: Blocked
    • Update membership

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

11. Global OG Group Permissions

See https://modulesunraveled.com/organic-groups-7x-2x/global-og-group-permissions.

Have a look at the permissions:

  • Configuration > Organic Groups > OG permissions overview (admin/config/group/permissions)
  • Click the "edit" link next to "Node - Group"

In the video follows a quick overview of Group permissions which will be treated more detailed in a follow-up episode.

Comparing the video and my Backdrop test site, the mentioned OG permissions in Drupal and Backdrop seem to be the same.

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

12. Organic Groups Global Roles

See https://modulesunraveled.com/organic-groups-7x-2x/organic-groups-global-roles.

Have a look at the roles:

  • Configuration > Organic Groups > OG Roles Overview (admin/config/group/roles)
  • Click the "edit" link next to "Node - Group"
  • You see three roles: non-member, member, administrator member

Add more roles:

  • Type "Content creator" in the field and hit the button "Add role"
  • Type "Content moderator" and hit the button

View the roles in the context of an existing group:

  • Group 1 > Group tab > Roles (read-only)
    You see the roles.

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

13. Global OG Group Content Permissions

See https://modulesunraveled.com/organic-groups-7x-2x/global-og-group-content-permissions.

Check the permission to administer all groups and permissions.

  • Drupal
    • People > Permissions" (admin/people/permissions)
  • Backdrop
    • Configuration > User accounts > Permissions (admin/config/people/permissions)

Configure member's permissions

  • Configuration > Organic Groups > OG permissions overview (admin/config/group/permissions)
  • Click "edit" next to "Node-Group"
  • Select permissions for "Content creator":
    • Create Post content
    • Edit own Post content
    • Delete own Post content
  • Save permissions

Give a group member the "Content creator" role

  • Group 3 > Group tab > People
  • Drupal:
    • Operations > Modify OG user roles
    • Check the box next to a member
    • Execute
    • Select "Content Creator" in the "Add roles" box
    • Next / Confirm
  • Backdrop:
    • Operations: not available
  • Workaround for Backdrop:
    • Click the "edit" link next to a member
    • Roles: Enable the checkbox "Content creator"
    • Click the button "Update membership"
      Note: After updating, you are not redirected to the People page. Until this is fixed, use e.g. the breadcrumb links to return to the group page.

Switch the account, and create a Post

  • Log in as a group member with the role "Content creator".
  • Go to your group. In the sidebar, you see a "Create content link" block
    (We configured the link above, see section 5).
  • Click "Add Post".
  • Title: My first group post
  • Body: (Lorem Ipsum)
  • Groups audience: Group 3
    (Aready selected, as configured above. and the field is disabled so that she can not change the “Groups audience”.)
  • Group content visibility: "Use group defaults"
  • Save
    Note: In Drupal, based on the field settings described in section 5, the same group member can't create content outside of the group. To get the same behavior in Backdrop, it might be necessary to adapt the workaround to compensate for the missing module Entity Reference Prepopulate.

Switch back, and configure Content moderator permissions

  • Configuration > Organic groups > OG permissions overview (admin/config/group/permissions)
  • Click the "edit" link next to "Node-Group"
  • Select permissions for Content moderator:
    • Post: Edit any Post content
    • Post: Delete any Post content
  • Save permissions

Give a group member the "Content moderator" role

  • Group 3 > Group tab > People
  • Click the "edit" link next to a member
  • Roles: Enable the checkbox "Content moderator", and disable "Content creator".
  • Click "Update membership"

Switch the account, and edit or delete posts from others

  • Log in as a group member with the role "Content moderator".
  • Go to your group.
    As expected, you can't create new posts anymore.
  • View a Post, and click the "Edit" tab.
  • Edit the Post, and save. Or delete it.

Switch back, and configure Content moderator permissions again

  • Group 3 > Group tab > People
  • Click the "edit" link next to a member
  • Roles: Enable also the checkbox "Content creator".
  • Click "Update membership"
    (Result: member can create Posts again and can still edit and delete all Posts.)

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

14. Group Specific Roles

See https://modulesunraveled.com/organic-groups-7x-2x/group-specific-roles.

Configure roles for specific groups

  • Add the "Group roles and permissions" field to the "Group" bundle
    • Configuration > Organic groups > OG field settings (admin/config/group/fields)
    • Bundles: Group
    • Fields: Group roles and permissions
    • Add field
  • Optional: hide OG field on display (not covered in the video):
    • admin/structure/types/manage/group/display/default
    • Group roles and permissions > Format: Hidden
    • Save
  • Configure Group 2 to override the default roles and permissions
    • Group 2 > Edit tab
    • Group roles and permissions: Override default roles and permissions
    • Save

Create role for specific groups

  • Create role "Page manager" for Group 2
    • Group 2 > Group tab > Roles
      Note: in contrast to other groups, the "Roles" (and "Permissions") link isn't marked as "read-only"
    • On the "Roles" page, type "Page manager" in the field at the bottom, and hit "Add role"

@olafgrabienski
Copy link
Member Author

15. Group Specific Permissions

tba

@olafgrabienski
Copy link
Member Author

16. Organic Groups Settings

tba

@olafgrabienski
Copy link
Member Author

17. Organic Groups Field Access

tba

@olafgrabienski
Copy link
Member Author

olafgrabienski commented Mar 3, 2022

18. Adding Additional Group Types

tba

See also the comment by @schoenid, #45 (comment).

@schoenid
Copy link

schoenid commented Apr 11, 2022

  1. Working with Content in Public and Private Groups
    ...
    Backdrop:
  • Content posted to public groups is public
  • Content posted to private groups is ... public (!)

Just confirmed.

I've added some content to a private group:

  • While creating a new content with setting Use group defaults it is still public. After editing the content, the setting was on Public - accessible to all site users. (strange ...)

    • After setting it again to Use group defaults it's state was stable and the content was private.
  • Not the same for Private - accessible only to group members ... after creating, the setting was correct at Private ..., but the content is public, altough the correct setting, while displaying the visibility.

    • I just opened it for editing and saved it again without any modification - et voila - the content was private!

Could this be a caching problem? I flushed the cache, but without any result in this behaviour.

@indigoxela
Copy link
Member

Could this be a caching problem? I flushed the cache, but without any result in this behaviour.

It's not actually that (regular) cache, what it needs is a permission rebuild (via /admin/reports/status/rebuild). Many permissions are correct after that - possibly not all.

@schoenid
Copy link

Thank you for the notice.

... what it needs is a permission rebuild ...

Ok. I see, for the moment everytime a new content is added, the permissions are required to be rebuilt ... or it has to be saved twice.

It's not enough, to rebuild the permissions cache once after installing Organic Groups, because there are new ones for the new content. That's what I didn't realize.

This seems to be a similar problem like Editing book child content failure (Bug) #46 - just on another scope. (It "feels" similar on my side.)

@indigoxela
Copy link
Member

for the moment everytime a new content is added, the permissions are required to be rebuilt ... or it has to be saved twice.

That clearly sounds like a bug. Might take a little time to dig into this. I'm not sure yet, in how far the book (outline) bug is related. Hopefully we'll figure out.

@schoenid
Copy link

schoenid commented May 3, 2022

Just to let you know ...

I've got now 3 Backdrop sites up and running, each with the Organic Groups module as a base for main content.

It feels great, not only to use it to handle groups of users, but also groups of content. Groups as a content container for thematics or genres and books for content gives me an extraordinary possibility to maintain content in hierarchies.

On the other side, to have groups with members feels really like working in a company with different divisions or like a school with different classes: all are working mainly independent, but in the same community.

@schoenid
Copy link

schoenid commented May 5, 2022

While working with additional "Group Types" (your Pt. 18), I've realized the following:

  • multiple content types can be created and selected as "Group"
  • On user accounts the "Group membership" is listed correctly by
    • Group type
      • Group
  • On content types as "Group content" Target bundles can be selected, multiple selections of existing groups are possible.
  • 👎 On contents only the groups of the first bundle are listed. A selection of other bundles is not possible.

@olafgrabienski olafgrabienski self-assigned this May 5, 2022
@olafgrabienski
Copy link
Member Author

While working with additional "Group Types" (your Pt. 18), I've realized the following

Thank you, very helpful! I'll have another look soon.

@argiepiano
Copy link
Collaborator

👎 On contents only the groups of the first bundle are listed. A selection of other bundles is not possible.

@schoenid there seems to be a bug in Drupal's OG which transferred to Backdrop. Check out the minute 1:51 of the video tutorial for step 18. The video shows that the target bundle was not selected, even though in a previous step, when adding the group content field, the author had selected "Video series".

Would it be possible that perhaps your issue arouse from the fact that you did not re-select the bundle during that step? I will take a look and see why the bundle selection is not being saved correctly when you do it through the Node Configuration OG vertical tab. In the meantime, would you mind check that again?

@argiepiano
Copy link
Collaborator

@schoenid - I've followed video 18 to test the bug you reported. I can verify that the step in minute 1:50 is very important. Apparently there is a bug in both D7 and Backdrop that results in the target bundle not being saved when you select it from the vertical tab in the ""Configure" of the node UI. So what happens then is that you have to go and open "Manage fields" for that node, and then configure the Group Audience field itself to select the correct bundle.

After this, when you create group content, you will be able to select only the groups that belong to that particular bundle.

I will open a separate issue to fix the problem of the bundle not being saved in the node configuration page.

@schoenid
Copy link

schoenid commented May 21, 2022

Would it be possible that perhaps your issue arouse from the fact that you did not re-select the bundle during that step? I will take a look and see why the bundle selection is not being saved correctly when you do it through the Node Configuration OG vertical tab. In the meantime, would you mind check that again?

I've selected that bundle correctly. I also selected the group on a re-edit base, even in the field management form of the group nodes content type. But this is working, if only one group is selected.

If you select two, out of a list of maybe 10 content-groups (multiple selections), the content can only be assigned to the first selected Target bundle. The other selected bundles or content groups do not show up in the content, where you could assign it.

As example: I configure "Posts" to be assigned to "Editor-Groups" and "Author-Groups" but not to "Visitor-Groups", so "Posts" should be group content belonging either to "Editor-Groups" or "Author-Groups". But only the first one "Author-Groups" is listed. So I can add Posts-content only to groups of type "Author-Groups", but not to groups of type "Editor-Groups".

As a workaround I could create a new content type: "Posts for Editors" - but this would not be a professional solution.

@argiepiano
Copy link
Collaborator

Thanks @schoenid. This looks like a bug. We should open a new issue for that to investigate a specific solution for that. Feel free to start a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants