Closed (fixed)
Project:
Flag content
Version:
5.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2008 at 10:27 UTC
Updated:
11 Mar 2008 at 23:23 UTC
My setup:
drupal 5.7
flag_content 2.5
Flag_content is turned on for some node types and comments, but disabled for users.
When viewing a user's profile, i get the following error:
warning: Invalid argument supplied for foreach() in /mnt/hgfs/trunk/modules/user/user.module on line 1527.
hook_user chokes when the $items variable in the code below is empty.
The following patch fixed it for me. It only sends data back to hook_user if there's something in $items. Patch Needs review:
Index: flag_content/flag_content.module
===================================================================
--- flag_content/flag_content.module (revision 807)
+++ flag_content/flag_content.module (revision 839)
@@ -133,5 +133,9 @@
);
}
- return array(t('Flag user') => $items);
+
+ if (is_array($items)) {
+ return array(t('Flag user') => $items);
+ }
+ break;
case 'delete':
Comments
Comment #1
kbahey commentedThanks. Fixed.
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.