Notice: Trying to get property of non-object in _login_security_get_variables_by_name() (line 384 of /home/sperry/work/sites/dotcr/d7/docroot/sites/all/modules/login_security/login_security.module).
(plus the same on 3 more lines)

_login_security_get_variables_by_name() does $account = user_load_by_name($name). If a user tries to login with a nonexistent username, warnings come from things like $account->name.

CommentFileSizeAuthor
login_security_bogususername.patch597 bytesscottsperry
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deekayen’s picture

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

I did a quick check and didn't reproduce this in the latest -dev. Please re-affirm it.

deekayen’s picture

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

Wrong status.

aitala’s picture

I have been getting this notice as well... like,

Notice: Trying to get property of non-object in _login_security_get_variables_by_name() (line 423 of .../sites/all/modules/contrib/login_security/login_security.module).

from anonymous hits to /user .

Note that I am getting basically the same notice with different line numbers - 418, 419, and 420.

I am running the 7.x-1.1 version of the Login Security module.

Modules I am using which could interact via interactions with the login path or user entities.

  • LoginToboggan 7.x-1.3
  • Profile 2 7.x-1.3
  • Profile Complete Percent 7.x-1.4 - which has a block on the /user page for authenticated users
  • CAPTCHA 7.x-1.0-beta2
  • reCAPTCHA 7.x-1.9
  • Honeypot 7.x-1.14
  • Real Name 7.x-1.1
shrop’s picture

I am seeing the same kind of thing. I am trying to nail down a bit more details than just the errors.

I am running 7.x-1.2. I need to give -dev a go and test again.

 163  23/Apr 20:40  notice   user           Login attempt failed for asdf.
 164  23/Apr 20:40  notice   php            Notice: Trying to get property of non-object in _login_security_get_variables_by_name() (line 418 of /path/to/login_security
 165  23/Apr 20:40  notice   php            Notice: Trying to get property of non-object in _login_security_get_variables_by_name() (line 419 of /path/to/login_security
 166  23/Apr 20:40  notice   php            Notice: Trying to get property of non-object in _login_security_get_variables_by_name() (line 420 of /path/to/login_security
 167  23/Apr 20:40  notice   php            Notice: Trying to get property of non-object in _login_security_get_variables_by_name() (line 423 of /path/to/login_security
 168  23/Apr 20:40  warning  php            Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /path/to/drupal/core
 169  23/Apr 20:40  warning  php            Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /path/to/drupal/core
shrop’s picture

Status: Closed (cannot reproduce) » Reviewed & tested by the community

I did a bit of testing and confirm that the login_security_bogususername.patch patch by @scottsperry does resolve the issue for 7.x-1.x-dev.

I recommend committing this.

Note: This does not fix the array_flip() related warnings. I will create another case for these since I have tracked them down to login_security.

Anonymous’s picture

Patch is needed indeed.

deekayen’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 7.x-1.4.

Status: Fixed » Closed (fixed)

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

  • deekayen committed 2467e5b on 7.x-1.x, 8.x-1.x authored by scottsperry
    Issue #1744704 by scottsperry: Fixed Warnings when attempting to login...