I keep receiving this error when trying to edit or view any of the flag views.

Fatal error: Call to a member function label() on a non-object in /drupal-7.x-dev/sites/all/modules/views/includes/admin.inc on line 1397

It's only happening to Flag views, and not any Views provided views, which is why I've placed the issue here to begin with at least.

Latest devs of CTools, Views and Flag (all 7.x).

Comments

sirkitree’s picture

This happens when trying to create a new view and as soon as you add the relationship "Flags: User's flagged content", a javascript alert comes up with this message.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: http://drupal-7/admin/structure/views/ajax/add-item/freinds2/default/relationship
StatusText: OK
ResponseText: 
Fatal error:  Call to a member function label() on a non-object in /Users/jbitner/Sites/drupal-7.x-dev/sites/all/modules/views/includes/admin.inc on line 1397

Guessing there's a bug in the relationship handler within Flag.

sirkitree’s picture

Project: Flag » Views (for Drupal 7)
Version: 7.x-2.x-dev » 7.x-3.x-dev
Component: Views integration » Code

Ok, disabling Flag altogether still produces this error - so moving this to views issue queue.

Latest D7 versions of Drupal core, CTools, and Views.

To reproduce, create a new view with User as the base and try to add a relationship:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: http://drupal-7/admin/structure/views/ajax/add-item/user/default/relationship
StatusText: OK
ResponseText: 
Fatal error:  Call to a member function label() on a non-object in /Users/jbitner/Sites/drupal-7.x-dev/sites/all/modules/views/includes/admin.inc on line 1397
Anonymous’s picture

Priority: Normal » Major

Happens as well with a freshly created node-based view, as soon as I try to define a relationship.

dawehner’s picture

dawehner’s picture

talatnat’s picture

Just as additional information: I get this error (pointing to line 1333 in admin.inc) when using Drupal 6.20 and Views 6.x-3.x-dev, but don't get it when using Drupal 6.19 and Views 6.x-3.x-dev. The error occurs when I am trying to set up a Backreference CCK Relationship in Views.
I am posting here since the Drupal 6 issue was closed as a duplicate.

Addition: I just upgraded to the Jan. 12 version of Views 6.x-3.x-dev, and it works just fine now. No fatal errors. Thanks.

dmcdenissen’s picture

I Was getting the following error:
Call to a member function label() on a non-object in .../sites/all/modules/views/includes/admin.inc on line 2278

Maybe someone has this also, I solved it by changing (on line 2277):
$handler = $display->handler->get_handler('relationship');
to:
$handler = $display->handler->get_handler('relationship', $id);