When I try to add a field to a view, I get this error pop-up:

An error occurred at http://localhost/drupal-cvs-image/?q=admin/build/views/ajax/add-item/ima...

The Firebug console shows the response to the POST is:

<b>Fatal error</b>:  Cannot break/continue 1 level in <b>D:\xampp\htdocs\drupal-cvs-image\sites\all\modules

\views\includes\admin.inc</b> on line <b>2145</b>

Looking at that line of code, there's a break statement and I can't see what control statement it refers to. It's nested in a few 'ifs', but nothing that can take a break. The rest of the function, apart from a call to views_ui_standard_form_buttons() and the return statement is wrapped in an else.
Should it be a return instead, or nothing at all?

I'm getting this intermittently. I think the first field I try to add works and it breaks after that.

Comments

joachim’s picture

The problem appears to be partly caused by a patch I'm trying for image.module that provides a field. Views doesn't seem to have found the handler for the field.

The problem is compounded in that after I've tried to add this bad field, I can't add any other field that has previously worked.

Incidentally, each time I get the error, a field gets added anyway, and shows on the field list (after the view is saved) like this:

Node: Body Body
Node: Title Title
Node: Body Body
Error: handler for image > nid doesn't exist!
Error: handler for image > nid doesn't exist!
Node: Body Body
Error: handler for image > nid doesn't exist!
Node: Nid Nid

It looks like Views is still searching for the same missing handler.

And the field rearrange list shows entries like this:

Broken field nid_1

merlinofchaos’s picture

Status: Active » Fixed

The break simply needs to be removed, which I've done in CVS. With that removed it should then at least not crash when you add the field, and you'll go directly to having to deal with the field not working.

The rest of the handling is correct; the field is broken, and Views isn't actually aware of when it became broken. In this case itw as broken when it was added, but as far as Views knows, it may have worked once and then became broken when a module was removed. What it does know is that the field doesn't work, and lets you know it.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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