Just thinking that this might be a good candidate to replace og-audience field (the field you select which groups a content is assigned to), so OG will work with something more generic.

Comments

Damien Tournoud’s picture

Indeed. We also have a couple of specialized entity reference field in Commerce that I would like to eventually replace with this (in the 2.x version).

amitaibu’s picture

Title: Use module in OG instead of custom group-audience field » Use module in OG instead of custom fields
Status: Active » Fixed

This is now part of #1261376: Entity-ify Roles

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

amitaibu’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Category: task » support
Status: Closed (fixed) » Active

I'm re-opening, for further discussion coming out from #1342632: Deprecate OG group entity

To reduce complexity I thought that every group-audience field should restrict the entity type/ bundle of group (i.e. showing only group of nodes) it shows. Obviously, that's exactly what ER (entity reference) is doing.

OG has it's own field type called group-audience. It's actually an entity-reference, but it has several differences:

  1. The values in the widget are determined per user -- og_field_widget_form()
  2. A privileged user can see an optgroup select list, showing "My group" and "Other groups" (I've actually thought it would be nicer to show the "My group" as one widget (e.g.g select list), and the "Other groups" as another (e.g. autocomplete)
  3. The values are actually not stored in the DB -- og_field_write() as we have the information stored in the OG membership entity

I wonder if I can fit the above needs into ER and depend on it.

fago’s picture

Interesting idea. Maybe it's possible to re-use just the widget(s) as the actual field storage is different?

KarenS’s picture

Title: Use module in OG instead of custom fields » Use Entity Reference in OG as group audience field

Re-titling so it's a little more clear in issue trackers. I think the idea of re-purposing entity reference for this makes a lot of sense. The question would be the best way to do things like limit the list of available entities and perhaps alter the place the values are stored. Or maybe OG could just take advantage of the field storage that it would get for free here and use it instead of storing it elsewhere.

amitaibu’s picture

Status: Active » Fixed

Let's close this issue in favor of #1342632: Deprecate OG group entity

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.