legal.module L592 - Call to user_load() passes an array containing uid. It should pass the uid directly. Causes warning below.

Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of C:\Program Files\xampp\htdocs\drupal-7.8\includes\entity.inc).

legal.module
592c592
<   $user = user_load(array('uid' => $values['uid']));
---
>   $user = user_load($values['uid']);
CommentFileSizeAuthor
#2 legal_Dec_13_2012.patch426 bytesgrantlucas

Comments

josh.hill’s picture

Title: Array passed to user_load() causing warning » Array passed to user_load() causes warning
grantlucas’s picture

Version: 7.x-1.1 » 7.x-1.2
StatusFileSize
new426 bytes

I can confirm this in drupal 7.9 as well and Legal 7.x-1.2. Added patch file which contains the same as posted above but in patch file format.

rooby’s picture

Status: Active » Fixed

This has been fixed in dev but not closed off.
See commit http://drupalcode.org/project/legal.git/commit/f8b4312

Status: Fixed » Closed (fixed)

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

oystercrackher’s picture

Status: Closed (fixed) » Active

Hi, I have made this one active again. I have tried installing the patch and the patch fails with error message as follows:

"patch failed: legal.module:582"
"legal.module: patch does not apply"

Please advise any thoughts on how to proceed further.

Thanks

grantlucas’s picture

Status: Active » Closed (fixed)

@oystercrackher This was fixed in the Dev branch months ago according to @rooby. I would recommend installing the 7.x-1.x-dev version of this module as it should be good there. If there is still an issue, I would open up a new ticket.

oystercrackher’s picture

Great. Thanks

Mat77’s picture

Hello,

Maybe this could be commited to the main release?
It's weird to have a "ready for production" release containing such a warning.

Anyway, thanks for this great module.

Matt