Helo,

I tried to restrict the access to data, available via autocompletion:

/**
 * Implements hook_permission()
 *
 * The following permissions are used to restrict access to data that could be
 * retreived via autocomplete paths.
 * 
 * @see hook_permission()
 */
function mymodule_permission() {
  return array(
    'access autocomplete data' => array(
      'title' => t('Access autocomplete data'),
      'description' => t('Allow users to access data for autocompletion.'),
    ),
  );
}

Using this code I got the following notices:

    Notice: Trying to get property of non-object in user_access() (line 790 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 802 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 803 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 809 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 812 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 790 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 802 of ./drupal/modules/user/user.module).
    Notice: Trying to get property of non-object in user_access() (line 812 of ./drupal/modules/user/user.module).

And this relates to:

function user_access($string, $account = NULL) {
  global $user;

  if (!isset($account)) {
    $account = $user;
  }

  // User #1 has all privileges:
  if ($account->uid == 1) {
    return TRUE;
  }

$account should be replaced by $user in the second if.

Comments

hevr’s picture

Status: Active » Needs review
droplet’s picture

Status: Needs review » Needs work

$account = $user; if no $account passed...

I guess you passed a non-object $account into this function.

hevr’s picture

$account = $user; if no $account passed...

yes of course... my patch and using $user->uid was wrong.

boabjohn’s picture

Sorry: I'm confused here...
We're getting the same error series as above. Happend after upgrades to CTools, Panels, and Views. Appears on admin/content and other views pages, but not on non-views admin pages.
Have you guys had a chance to look more into the problem?
Keen to hear,
JB

Anonymous’s picture

Is this a problem with core, or a problem with something in Ctools, Panels and/or Views? There seems to be some similar issues floating around all having the somewhat same solution/cause: upgrading to the lastest dev of Views and Ctools.

Any ideas?

monsoon’s picture

I have similar problem. Anyone has solution so far??

jeremymcminn’s picture

Am also getting this error, but only on the admin/config page. Any idea what this is?

monsoon’s picture

I got rid of this nasty display by changing "Error messages to display" to
"None"
in the following:
/admin/config/development/logging

Hope this helps.. others. I guess this simply blocks displaying of error messages.

droplet’s picture

Status: Needs work » Postponed (maintainer needs more info)

backtrace or disable some module to figure out the problem. It doesn't looks like the CORE issue

harri00413’s picture

Had same problem, switched off module Security Review 7.x-1.0, problem gone.

jpwester’s picture

Is anyone else experiencing this? It just started popping up on one of our sites.

VanessaM’s picture

Hi,
I started experiencing these errors as soon as I installed the Administration views module. When I disabled the module the errors went away.

dddave’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

per #9 + this issue is tagged for a very old version

This most likely is caused by a module anyways so you'll have to hunt it down.

joelpittet’s picture

Security Review for me too, turned that off bingo.

flyke’s picture

I just recently saw this error a lot on a certain Drupal 7 site of me after updating all my modules.
I tested te applied patch manually by editing modules/user/user.module on line 808 from if ($account->uid == 1) to if ($user->uid == 1).

Now all my errors are gone and site is working as normal.

- I do not have the module Security Review installed
- I DO have the modules Administration Views and Views Bulk Operations installed