og_complex widget (aka the widget to select organic groups) allows admin to select what type of widget to use for the default and admin behaviour, but alas does not provide any way to configure those widgets, only allowing the default behaviour for the widgets to be used. If add in the configure form for those widgets, would thus be able to configure the settings, which for some widgets is needed to get them working (select2 is widget I am struggling with)

CommentFileSizeAuthor
#1 2403619-og_widget_settings-1.patch3.99 KBhefox
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hefox’s picture

Status: Active » Needs review
FileSize
3.99 KB
mpotter’s picture

Status: Needs review » Reviewed & tested by the community

Using this in Open Atrium. Important to support widget settings.

HelenaEksler’s picture

@amitaibu I've reviewed and also applied the patch. Looks good, working as expected.

amitaibu’s picture

Status: Reviewed & tested by the community » Needs work

Thanks, a few nitpicks:

  1. +++ b/plugins/entityreference/behavior/OgWidgetHandler.class.php
    @@ -39,8 +41,10 @@ class OgWidgetHandler extends EntityReference_BehaviorHandler_Abstract {
    +      $settings_id = 'og-' . $field_type . '-settings';
    

    use drupal_html_id()

  2. +++ b/plugins/entityreference/behavior/OgWidgetHandler.class.php
    @@ -48,7 +52,36 @@ class OgWidgetHandler extends EntityReference_BehaviorHandler_Abstract {
    +      if ($settings[$field_type]['widget_type'] && !empty($field_info_widget_types[$settings[$field_type]['widget_type']])) {
    

    This needs a comment or two :)

  3. +++ b/plugins/entityreference/behavior/OgWidgetHandler.class.php
    @@ -48,7 +52,36 @@ class OgWidgetHandler extends EntityReference_BehaviorHandler_Abstract {
    +        $additions = module_invoke($widget_type['module'], 'field_widget_settings_form', $field, $fake_instance);
    

    if ($additions = ...) {