Closed (works as designed)
Project:
LoginToboggan
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2010 at 12:07 UTC
Updated:
5 May 2011 at 16:41 UTC
There on row 158 is an assignment, which does not validate input and therefore warnings arise.
Please do substitute the row in question with:
$in_pre_auth_role = is_array($account->roles) ? in_array($id, array_keys($account->roles)): NULL;
Comments
Comment #1
hunmonk commentedline 172 of user.module -- $account->roles should always be an array. you most likely have another module installed that's doing something nasty with the user object. i recommend locating that module and filing a bug against it.
Comment #2
knievel commentedi got the same problem.
in line 155 there is an assignment of some form element to $account:
$account = $form['_account']['#value'];
if you do some form preprocessing this element could possibly not be set.
so your statement that $account->roles should always be an array is not always true.
i slightly modified the solution i.garnizov mentioned, because in_array() returns false instead of null.
$in_pre_auth_role = is_array($account->roles) ? in_array($id, array_keys($account->roles)): FALSE;
Comment #3
hunmonk commentedthen the preprocessing is not being done correctly. the module can't be responsible for other coders not following core standards.