After enabling Variable and I18N modules I'm getting this notice.

Notice: Undefined index: relationship in view->fix_missing_relationships() (line 427 of /home/aries/public_html/sites/all/modules/views/includes/view.inc).

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

In general is this issue solved for you on the current dev version?

Additional i recommend you to read http://drupal.org/node/571990 to provide helpful informations which are needed to fix the bug. Thanks!

BeaPower’s picture

I get this error too, how exactly do you fix this?

mikkovedru’s picture

I got this problem as well (after installing different modules including i18N).

The error I get is "Notice: Undefined index: relationship in view->fix_missing_relationships() (line 427 of /sites/all/modules/views/includes/view.inc)."

My current setup is:
- Views. 7.x-3.0-rc1 (2011-Jun-17).

Updated to the latest dev version
- Views. 7.x-3.x-dev (2011-Jul-26)

Didn't help - same problem.

mikkovedru’s picture

Status: Postponed (maintainer needs more info) » Active
dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Obvious you didn't read the issue linked above.

mikkovedru’s picture

I did. And I provided every detail I knew. I am new to Drupal and have never debugged internet/PHP code, so there is very little I can do.

Would you be interested in getting the admin login and checking the issue yourself?

dawehner’s picture

Really?

Try to reproduce your issue with the most minimal installation possible. It's nearly always a good idea to export your view, so that the problem can be reproduced. Many views can't be imported if they are dependant on CCK fields on your system.
becw’s picture

I was seeing this error, too. It happened when view::fix_missing_relationships() was passed a field that has been moved; ie, the column only contains a field with a 'moved to' property. For some Drupal fields, this gets built out as part of field_views_field_default_views_data().

I found that it was triggered by a view with a broken/missing relationship handler--ie, I had changed my code and broken my view. This was custom Views integration for a Drupal field. The error went away when I deleted the view, which was a testing view anyway.

@mikkovedru -- I would suggest checking your views to see if there's one with a relationship marked "broken/missing handler". I'm not sure, but this might happen if you updated your site from one version of Views to another, or if you're using the development version of a module that provides a field.

dawehner’s picture

StatusFileSize
new1.04 KB

I'm not sure whether this works, but it would be nice if someone could try this out.

mikkovedru’s picture

@dereine
Tried it. Didn't help. I get the exact same error ( "Notice: Undefined index: relationship in view->fix_missing_relationships() (line 427 of /sites/all/modules/views/includes/view.inc)." ).

@becw
Could you please tell me how can I do that? I went to /admin/structure/views . Should I have seen some kind of error there? I didn't notice anything.

Then I pressed "Edit" for every item. Most of them were ok (doesn't say much since I don't have much experience). But I noticed problems for two of them!

1. "Taxonomy term (Content)"-item.
- On top of the page displays a red "Notice: Undefined index: relationship in view->fix_missing_relationships() (line 427 of /sites/all/modules/views/includes/view.inc)." error.
- The RELATIONSHIPS group has two entries: "Broken/missing handler" and "Content: Taxonomy terms on node".

2. "List Node Page Titles (Content)".
- The RELATIONSHIPS group is empty
- On the very top of the page displays a GREEN NUMBER. The number changes. Three examples of the number: "1314072498", "1314073023", "1314073086". It's only a theory, but it would seem that the number grows by one every second (1/s).
- A little lower than the previous green message, there is a red "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_title.language' in 'field list'" error message.

Does this information help? Do you need any other information to locate the problem?

becw’s picture

@mikkovedru The "Taxonomy term (Content)" view is probably causing your error. It sounds like one of the handlers you're using broke somewhere in the update path--it would be really helpful if you could export the view and provide it here, so that we can check whether it's a standard handler that should update smoothly. After you make a copy of the original view, removing that missing relationship (and replacing it with a working relationship), the "undefined index" notice will go away.

As far as the green number on your "List Node Page Titles (Content)" view goes, it's possible that it is debug code left over somewhere. I'm not sure where the unknown column error would come from. Did you recently update your site to Drupal 7 and Views 3? If so, what Drupal and Views versions did you update from?

mikkovedru’s picture

@becw
I exported both of the views in question. Is this what you asked? I'm not sure.

No, I didn't update. It was a fresh Drupal 7 (7.4?) install. Then I installed Views 7.x-3.0-rc1. After that at some point I got a problem (maybe it was related to OG, maybe not) and tried to install to 7.x-3.x-dev. Didn't help. So currently I still am using the Views dev version.

After you make a copy of the original view, removing that missing relationship (and replacing it with a working relationship), the "undefined index" notice will go away.

I am sorry, but I didn't understand. :( What exactly should I do to fix the problem? Or will you first look at the provided views and try to fix the problem via patch?

Aurochs’s picture

I have below mistake after upgrading from d6 to d7, i had views3 in d6 for long time.

- A little lower than the previous green message, there is a red "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_title.language' in 'field list'" error message.

dawehner’s picture

@Aurochs
That's another classical issue with the page title module, maybe you have a look at this queue/update to latest dev.

tim.plunkett’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

If this is still an issue, please reopen with clear steps to reproduce.

Gastonia’s picture

Version: 7.x-3.0-rc1 » 7.x-3.3
Status: Closed (cannot reproduce) » Active

Getting this error as well. Here is how I get it.

I am writing a custom module that uses the views hook pre_view to change views variables before they are executed. The code works fine, the module works fine, but here is the function that causes the error message to display. Again, code is functioning fine, regardless, at least so it appears.

function zipcode_filter_views_pre_view 	( 	&$view, &$display_id, &$args	 ) {

if($_SESSION['zipcode_filter']['zip']){
	
	$view->display['default']->handler->options['filters']['distance']['value']['postal_code'] = $_SESSION['zipcode_filter']['zip'];
	$view->display['default']->handler->options['filters']['distance']['value']['search_distance'] = $_SESSION['zipcode_filter']['distance'];
}
}

If I comment out those two lines in my module the message goes away. Hope that helps.

pounard’s picture

I'm experiencing this bug too with latest stable. It's going rogue on an altered Commerce view. I have no missing or broken relationships at all. Sadly I cannot give you a way to reproduce this is higly tied to business code I can't share.

Note that I also experience these notices when installing my features, it happens with almost every view of the site.

warmth’s picture

subscribed

oakulm’s picture

This came up while installing Drupalcommerce backoffice: https://drupal.org/project/commerce_backoffice

oakulm’s picture

Issue summary: View changes

fix typo