Navigated to this page on a brand new install:
admin/structure/spaces/list/og_controlled/edit

And saw this:

Notice: Undefined variable: group_form in _spaces_og_form_spaces_preset_editor_alter() (line 235 of modules/all/spaces/spaces_og/spaces_og.pages.inc).

Warning: array_intersect_key(): Argument #1 is not an array in _spaces_og_form_spaces_preset_editor_alter() (line 235 of modules/all/spaces/spaces_og/spaces_og.pages.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jasonawant’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev
FileSize
675 bytes

Hello,

This is still present in 7.x-3.x-dev.

From what I can tell from my limited experience $group_form needs to be defined as array before using it in array_intersect_key.

I add the following to spaces_og.pages.inc

$group_form = array();
    
$group_form = array_intersect_key($group_form, $keys);

I've just started working with spaces 3.x and spaces_og, so I'm not any where near up to speed on what's going here.

Jason.

jeffschuler’s picture

Status: Active » Needs work

This removes the warning, but there's no point in doing an array_intersect_key() with an empty array as the first parameter.

A couple lines up from there, the setting of $group_form is commented-out.

// $group_form = og_group_form(array(), $form_state);

Looks like this was done in this commit by @webflo, but is undocumented, (his commit message just says "fix stash".)

jeffschuler’s picture

Well, the lines with og_group_form() and og_access_alter_group_form() are commented-out because those functions no longer exist, but I'm not familiar enough with this yet to know what we should be doing instead.

The attached patch really does nothing different than that in #1, but applies the patch from the correct directory, fixes whitespace, and adds a @TODO comment.

zikaelismik’s picture

Hi, i'm trying to make spaces 7.3.x to work with organic groups and i'm facing a problem i suppose it is related to this issue. Each time i try to edit a group preset i get these undefinex index messages

  • Undefined index: og_selective, og_ in _spaces_og_form_spaces_preset_editor_alter()
  • Undefined index: og_register, og_ in _spaces_og_form_spaces_preset_editor_alter()
  • Undefined index: og_directory, og_ in _spaces_og_form_spaces_preset_editor_alter()
  • Undefined index: og_private, og_ in _spaces_og_form_spaces_preset_editor_alter()

I guess since there is this comment:

// @TODO: $group_form is no longer being populated above.
    // What should we be doing here?
    //$group_form = array_intersect_key($group_form, $keys);
    $group_form = array();

this problem has not been addressed yet.
Obviously the Og Settings panel in the preset edit is empty.
I tried to apply the patch #3 but still get these errors and still can't use the module.
Another thing i'm seeing is that og_access.js is missing from the og_access module. I mean that there isn't a js in the og package. Don't know if it used to be there and they removed it but i guess this line

drupal_add_js(drupal_get_path('module', 'og_access') . '/og_access.js');

is no longer needed?

Thanks for any help
M