Steps to reproduce on clean install:

1) Create a new view.
2) Add a relationship to "Upload: Attached files"
3) Add field "File: Name"

Expected result: field gets added to view.
Actual result: Javascript alert box "An error occurred at http://localhost/admin/build/views/ajax/add-item/Testview/default/field."

Workaround: Click the browser's refresh button. You will see that the field has in fact been added to the "Fields" section.

More info: From debugging the Ajax call in Firebug, I can see the following is being returned in the stack trace:

Fatal error: Call to a member function get_handlers() on a non-object in /sites/all/modules/views/handlers/views_handler_field.inc on line 252
Call Stack
#	Time	Function	Location
1	0.0002	{main}( )	. ./index.php:0
2	0.1787	menu_execute_active_handler( )	../index.php:18
3	0.2028	call_user_func_array ( )	../menu.inc :348
4	0.2028	views_ui_ajax_form( )	../menu.inc:0
5	0.2963	views_ajax_form_wrapper( )	../admin.inc:1594
6	0.2963	drupal_build_form( )	../ajax.inc:111
7	0.2963	_drupal_build_form( )	../views.module:1032
8	0.2964	call_user_func_array ( )	../form.inc:48
9	0.2964	drupal_retrieve_form( )	../form.inc:0
10	0.2964	call_user_func_array ( )	../form.inc :366
11	0.2964	views_ui_config_item_form( )	../form.inc:0
12	0.3304	views_handler_field_file->options_form( )	../admin.inc:2318
13	0.3304	views_handler_field->options_form( )	../views_handler_field_file .inc:27

The line of code in question:

// Get a list of the available fields and arguments for token replacement.
$options = array();
foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {

The problem I think is that $this->view->display_handler is not set to anything.

Thanks !

Comments

merlinofchaos’s picture

First, thank you for the AWESOMELY detailed bug report. This is incredibly refreshing.

Second, is this the same as http://drupal.org/node/380560 -- if it is we should combine them. The extra data may be helpful.

Mark Theunissen’s picture

Status: Active » Closed (duplicate)

It's my pleasure, thanks for a great module!

I will mark this one as a duplicate and post a link back for gordon because he was looking for info on how to reproduce.