I'm getting the following error on 7.x-1.0

Notice: Undefined offset: 0 in _views_table_highlighter_cook_fields() (line 25 of ...\sites\all\modules\views_table_highlighter\views_table_highlighter.module).

Other than this, the release seems to be working well. The table shows properly highlighted below the errors; the same error is repeated quite a bit (e.g. 16 times with only 6 results & 1 field in the table).

Thanks.

CommentFileSizeAuthor
#4 views_table_highlighter-cook-00.patch705 bytessmokris

Comments

smokris’s picture

Title: Undefined offset » Notice: Undefined offset: 0 in _views_table_highlighter_cook_fields()
Component: Miscellaneous » Code
Status: Active » Postponed (maintainer needs more info)

Thanks for the feedback, @ryantollefson.

Could you export your view and attach it to this issue, so I can determine which field is generating that error?

ryantollefson’s picture

I just created a new view for testing. It has only 2 fields in it, and everything else pretty much as defaults. I am getting the same errors with it (but below the errors, the table is highlighted properly).

Here is the attached export:

$view = new view;
$view->name = 'test_highlighter';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'test highlighter';
$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'] = 'test highlighter';
$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['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'table_highlighter';
$handler->display->display_options['style_options']['columns'] = array(
  'title' => 'title',
  'field_project_priority' => 'field_project_priority',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'title' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'field_project_priority' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
);
$handler->display->display_options['style_options']['override'] = 1;
$handler->display->display_options['style_options']['sticky'] = 0;
$handler->display->display_options['style_options']['empty_table'] = 0;
/* 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']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Field: Content: Priority */
$handler->display->display_options['fields']['field_project_priority']['id'] = 'field_project_priority';
$handler->display->display_options['fields']['field_project_priority']['table'] = 'field_data_field_project_priority';
$handler->display->display_options['fields']['field_project_priority']['field'] = 'field_project_priority';
$handler->display->display_options['fields']['field_project_priority']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_project_priority']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_project_priority']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_project_priority']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_project_priority']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_project_priority']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_project_priority']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_project_priority']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_project_priority']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_project_priority']['field_api_classes'] = 0;
/* 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(
  'customer_project' => 'customer_project',
);

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

Assigned: Unassigned » smokris
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new705 bytes

@ryantollefson: Got it. Thanks for the details.

I've attached a patch — could you apply it and verify that it solves the problem on your site?

asep.sutisna’s picture

Thanks smokris. It works!

ryantollefson’s picture

Status: Needs review » Reviewed & tested by the community

Working for me. :)
Thanks!

smokris’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the confirmation, @ryantollefson and @asep.sutisna.

Committed patch; released 7.x-1.1.

Status: Fixed » Closed (fixed)

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