Og subspaces selection handler overrides it so that public groups AND subgroups of user can be used under "my groups", but og.field.inc decides which gids to send to "my groups" vs "other" in og_field_widget_form via it's internal functions, which doesn't follow that logic, so the default value for that field on create forms isn't set.

To reproduce

1) Create an admin user
2) visit a space that user is not part of
3) visit create section
Expected: Spaces is set to current space
Actual results: Not set

1) Edit a piece of content in a space the user is not part of
Expected: space field is set to it's space
Actual: space field is empty

Comments

hefox’s picture

Added some workarounds for now

mpotter’s picture

This works for non-admin users. But a user with Drupal admin role, the Spaces is still not set. The space is shown in the Other groups field instead.

Looks like the code is checking for !isset($form[OA_SPACE_FIELD][LANGUAGE_NONE][0]['admin'])
If I comment out this line then it works for admin users, but it shows the space in both the Space and the Other groups fields. Not sure if we need to unset the default for Other groups or not.

mpotter’s picture

OK, added some lines that should also fix this for admin users.

mpotter’s picture

Status: Active » Postponed

Might be better to handle this in the patch to reference_option_limit to work with the OG field? That is here #1986532: Support organic groups OG reference widget. When that is resolved, the commits in this issue can be reverted.

http://cgit.drupalcode.org/oa_core/commit/?id=086ac95
http://cgit.drupalcode.org/oa_core/commit/?id=c67288e

Argus’s picture

Status: Postponed » Postponed (maintainer needs more info)

Is this issue still present in the current version of OA?. Or can we close it?