From db33fb11ea96eca484c0431b7da50ecb9e4b79c4 Mon Sep 17 00:00:00 2001
From: aspilicious <aspilicious@172527.no-reply.drupal.org>
Date: Sun, 10 Jun 2012 12:36:09 -0400
Subject: [PATCH] Issue #1626396 by aspilicious: Adapt to changes in role
 machine names.

---
 modules/node.views.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/node.views.inc b/modules/node.views.inc
index 70abd1d915cc..06b5ae9fa252 100644
--- a/modules/node.views.inc
+++ b/modules/node.views.inc
@@ -718,17 +718,17 @@ function node_views_analyze($view) {
         if (empty($access['type']) || $access['type'] == 'none') {
           $select = db_select('role', 'r');
           $select->innerJoin('role_permission', 'p', 'r.rid = p.rid');
-          $result = $select->fields('r', array('name'))
+          $result = $select->fields('r', array('rid'))
             ->fields('p', array('permission'))
-            ->condition('r.name', array('anonymous user', 'authenticated user'), 'IN')
+            ->condition('r.rid', array('anonymous', 'authenticated'), 'IN')
             ->condition('p.permission', 'access content')
             ->execute();
 
           foreach ($result as $role) {
             $role->safe = TRUE;
-            $roles[$role->name] = $role;
+            $roles[$role->rid] = $role;
           }
-          if (!($roles['anonymous user']->safe && $roles['authenticated user']->safe)) {
+          if (!($roles['anonymous']->safe && $roles['authenticated']->safe)) {
             $ret[] = views_ui_analysis(t('Some roles lack permission to access content, but display %display has no access control.', array('%display' => $display->display_title)), 'warning');
           }
           $filters = $display->handler->get_option('filters');
-- 
GitLab