Hi,

for whatever reason we created a view that triggered class oa_core_og_group_ref_views_handler_filter_in_operator in profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc

There in line 13 you have an if() clause, which if successful will set $id = XY. However, after the if() you use $id anyway. This caused notices, though it seemed to work anyway, not sure though, was a strange view and we rebuild it differently anyway.

Comments

jkingsnorth’s picture

Status: Active » Postponed (maintainer needs more info)

Hi I've been trying to recreate this error but I haven't been able to.

If someone can come up with the exact steps required to recreate the issue (and perhaps an export of the view that is causing it) then we can take a closer look at what's going on =]

mpotter’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Please reopen this issue with steps to reproduce it if it still happens in v2.23.

wodzik’s picture

I have the same in v2.23.

Errors:

    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 25 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 31 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 36 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 48 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 25 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 31 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 36 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 48 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).

view:

$view = new view();
$view->name = 'sp';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Sp';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Sp';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'table';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'oa_space' => 'oa_space',
);
/* Filter criterion: Content: Parents (oa_parent_space) */
$handler->display->display_options['filters']['oa_parent_space_target_id']['id'] = 'oa_parent_space_target_id';
$handler->display->display_options['filters']['oa_parent_space_target_id']['table'] = 'og_membership';
$handler->display->display_options['filters']['oa_parent_space_target_id']['field'] = 'oa_parent_space_target_id';
$handler->display->display_options['filters']['oa_parent_space_target_id']['operator'] = 'empty';

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'sp';
wodzik’s picture

Status: Closed (cannot reproduce) » Active
mpotter’s picture

Not exactly sure the logic here. There are 2 conditionals in the first "if". One checks the $id, the other checks an auto option. I think it needs to be broken into 2 separate if statements.

Added a patch here. Please let me know if it fixes the warnings, but also if it has any bad effect on the operation of the exposed filters.

mpotter’s picture

Status: Active » Needs review
wodzik’s picture

after patch:

    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 16 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 24 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 30 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 35 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
    Notice: Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() (line 45 of /home/wodzik/projects/openatrium/profiles/openatrium/modules/contrib/oa_core/plugins/views/oa_core_og_group_ref_views_handler_filter_in_operator.inc).
wodzik’s picture

Status: Needs review » Active
mpotter’s picture

Status: Active » Needs review

Are you sure you applied the patch correctly? There is no way for $id to be undefined on line 16. It's defined on line 14 and the test on line 13 ensures it exists.

mpotter’s picture

Status: Needs review » Fixed

Committed this patch to the -dev of oa_core.

Status: Fixed » Closed (fixed)

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

m0nst4’s picture

Hello, im kinda new to oa and drupal aswell
ive got a similar problem, ive imported some data as a new contenttype with a field that contains the parent space.
Now i want to show these items in a view. With parents-filter i got no result. if i use Groups-audience it does perfectly what i want but i get 5 times Undefined variable: id in oa_core_og_group_ref_views_handler_filter_in_operator->init() in 16,24,30,35,45.

For every little help or idea i would be very thankful :)