In the Issue's of the Relation module ( http://drupal.org/node/1322814 ) several Drupalers mention the problem Undefined offset: 0 in views_handler_field_field->option_definition(), an error in sites/all/modules/views/modules/field/views_handler_field_field.inc.

The problem occured on my site after removing several fields but other Drupalers mention other circumstances. I do not have the Relation module installed.

CommentFileSizeAuthor
#2 1352268.patch919 bytesdawehner

Comments

dawehner’s picture

Sadly this report doesn't explain how to reproduce it.

Actually this means that the following code produces an empty $column_names array, maybe you can understand why
but i think this should never be possible.

 $field = field_info_field($this->definition['field_name']);
 $field_type = field_info_field_types($field['type']);
 $column_names = array_keys($field['columns']);
dawehner’s picture

Status: Active » Needs review
StatusFileSize
new919 bytes

Okay here is a patch.

The false assumption was that there are no fields without any columns.

Please test the patch, if it works for you, the patch can be commited.

mikran’s picture

Status: Needs review » Reviewed & tested by the community

I had several views with this notice in my installation and after applying the patch all those work as expected.

adam_b’s picture

Wow, that's efficient... 3.5 hours between the original bug report and testing the patch? Impressive :)

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing! Commited to 7.x-3.x

Anonymous’s picture

@Dereine: your are right, my information was sparse but the the causes were complicated to investigate because other modules were involved.

Fortunately you succeeded to patch and it worked for me too. Thank you very much!

nathan.bolin’s picture

+1 for patch posted in #2 by dereine

Corrected these errors:

Notice: Undefined offset: 0 in views_handler_field_field→option_definition() (line 293 of /home/lwebg/public_html/blueribbon/sites/all/modules/views/modules/field/views_handler_field_field.inc).

Notice: Undefined offset: 0 in views_handler_field_field→option_definition() (line 293 of /home/lwebg/public_html/blueribbon/sites/all/modules/views/modules/field/views_handler_field_field.inc)

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

extra information