On the drupal.org d7 upgrade test site, we're getting this PHP notice-level warning on many pages of the site:

Notice: Undefined index: relationship in view->fix_missing_relationships() (line 579 of /var/www/dev/new-drupal_7.redesign.devdrupal.org/htdocs/sites/all/modules/views/includes/view.inc).

This seems to be similar to another Views issue but I wasn't sure if it was a duplicate or not:
#1358938: Undefined index: base in view->fix_missing_relationships() when running phpupdate after upgrade
since that message came from the update.php script, and this message happens on every page.

The message is coming from these lines of code in includes/view.inc method fix_missing_relationship():

     if (isset($data[$options['field']])) {
        $base_tables[$data[$options['field']]['relationship']['base']] = TRUE;
      }

So it looks like $data[$options['field']] does not have a 'relationship' element. The attached patch makes the warning go away.

CommentFileSizeAuthor
relationships_php_notice_fix.patch609 bytesjhodgdon

Comments

jhodgdon’s picture

Issue tags: +drupal.org D7, +porting

Forgot tags.

dawehner’s picture

Status: Needs review » Fixed

This looks perfect even i'm not sure how this can happen. Thanks!

Let's get it into 7.x-3.x and 8.x-3.x

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