backdrop-contrib / og

The Organic Groups module provides users the ability to create, manage, and delete 'groups' on a site.
GNU General Public License v2.0
1 stars 8 forks source link

Improve clarity and functionality of OG vertical tab in content type configuration #103

Closed argiepiano closed 2 years ago

argiepiano commented 2 years ago

As reported in https://github.com/backdrop-contrib/og/issues/45#issuecomment-1133360899, the target bundle is not being saved when selected in the Vertical Tab of the node "Configure" page. This problem also exists in D7.

argiepiano commented 2 years ago

The problem is more complex than it seems at first, and it's the result a poor design that also affects the D7 version. In a nutshell, this is what's happening:

Assume you have two Content Types - the "Group type 1" bundle and "Group type 2" bundle - that are used to create group nodes.

Now assume you are creating two Content Types that will provide content for the groups of bundles "Group type 1" and "Group type 2" each (let's call them "Content for group type 1" and "Content for groups type 2").

Now let's say you are in the process of creating the content type "Content for group type 1". When you use the Organic Group vertical tab to assign a "Group content" field to it, OG creates the field info and field instance entries in the config folder of the site, and it assigns the select "Target type" (node) and "Target bundle" (Group type 1) correctly. The new field is called (by default) og_group_ref, and it's an entity reference field. All good 👍🏽

Now let's say you are in the process of creating the other content type, "Content for groups type 2." When you use the OG vertical tab to assign a "Group content" field to it, Backdrop has already created the field info for og_group_ref and has assigned the "Target type" and "Target bundle" to it (see above). So NO MATTER what you select in the UI for Target bundle, it will not change. :-1: To change it you have to change the field itself through "Manage fields" and then configure the "Global settings" of the og_group_ref field itself.

This is why, apparently, the OG vertical tab "Target bundle" select is not working. It works fine the first time you create the field, but then it just ignores whatever selection you make.

In a nutshell - messy, messy, messy. I feel like this OG vertical tab needs major overhaul.

argiepiano commented 2 years ago

PR #104. This PR significantly clarifies what can and can't be done with the OG vertical tab in the Content Type configure page. I still need to do some testing (e.g. with a clean install). I'll appreciate additional testing, questions, or concerns.

stpaultim commented 2 years ago

Didn't have time to test bug. Looked at text changes and think they are helpful.

I would like to offer additional suggestions for improvement, but no energy tonight. Maybe later this weekend. We might be able to shorten the text a little and use the word "bundle" less often. ;-)

argiepiano commented 2 years ago

Latest commit adds summary information to the vertical tab - as requested in #8. I will close that issue since this is addressed here.

stpaultim commented 2 years ago

I think this one looks pretty good.

argiepiano commented 2 years ago

Thank you @stpaultim for checking this one. I'll merge in a moment.