If the php error level is set to display notices (which is my case in my dev environment), there can be a php notice if trying to masquerade with a username with the Alternate login module enabled.
The PHP Notice says :
Notice : Trying to get property of non-object dans masquerade_block_1_validate()
And it refers to the line 626 of masquerade.module :

$alt_login = db_query("SELECT u.name FROM {users} u INNER JOIN {alt_login} al ON u.uid = al.uid WHERE al.alt_login = :alt_login", array(
      ':alt_login' => $name
    ))->fetchObject();
    if ($alt_login->name) {

If nothing returns from the db_query, the fetchObject method returns false, and the call to the property name of a boolean generates a PHP notice.
You just have to test for the return value, as followed :

if($alt_login && $alt_login->name) {

Here is a small patch.

CommentFileSizeAuthor
masquerade_alt_login.patch588 bytesiannakin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deekayen’s picture

Status: Active » Fixed

committed a fix using isset() instead

Status: Fixed » Closed (fixed)

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