Closed (duplicate)
Project:
Privatemsg
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2006 at 23:18 UTC
Updated:
6 Jun 2006 at 17:42 UTC
Drupal 4.7 - CVS as of date of this post
MySQL 4.x
PHP 4.4.x
Running Apache/MySQL on Debian
I'm getting an error on certain pages in my site - /node for example, as well as viewing nodes in their entirety. The errors that are generated are:
* warning: array_keys(): The first argument should be an array in /var/www/modules/user.module on line 339.
* warning: implode(): Bad arguments. in /var/www/modules/user.module on line 339.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /var/www/includes/database.mysql.inc on line 120.
I found this post which concerns the same errors, but the fix there doesn't work (or didn't work for me).
I'm aware that this may not be a bug and am OK with changing it to a support request if that is the generally accepted consensus, but I wanted to post it as a bug in case it was in order to bring it to the attention of the Drupal developers.
Regards
Patrick
Comments
Comment #1
gregglesThe problem is in the "WHERE r.rid IN ()" section since there should be something inside of the "()". Likely there should be a variable in there that is not getting populated for some reason.
Comment #2
drewish commentedwhat modules are you running? anything that affects access control?
Comment #3
Patrick Nelson commenteddrewish and greggles,
thx for responding to this post. I can see that something should be in that variable but I don't know what or why it's missing.
With regards to modules, the ones I have installed are:
There are other modules uploaded to the modules directory but these are not enabled. They shouldn't affect anything, right? (Or am I wrong?). As far as I know none of the installed modules have any degree of access control at all.
However, I am planning to install taxonomy_access at some point. If installing it makes the problem disappear, is that a good thing as in the error is no longer being generated, or a bad thing because the error is still there but taxonomy_access is masking it? Or will it make no difference anyway?
Thx again for your help.
Comment #4
Patrick Nelson commentedI've tracked this error to my patched version of privatemsg module. Specifically to the setting under "Write to author" which allows you to "Display link with posts" (Provide a link to send private messages to users with posts they start).
Having this switched on produces that error.
I'm going to change this post to make it an issue under that module instead.
Thanks for your help though.
Comment #5
thomherfs commentedHas this been fixed yet?
Private messaging is a pretty basic and much needed function for most community-oriented websites. This is going to make 4.7 completely unusable for at least five sites that I have to update.
Comment #6
lunas commentedI'm still getting these errors on 4.7 beta 5. So, no, I guess it hasn't been fixed yet. If I could I would :)
Comment #7
knockingsoul commentedIts happening on my brand new DEV server running fresh copy of beta 5
drupal 4.7.0 beta 5
php 5
mysql 5
apache 2.x
I am guessing the developers are aware of this issue (I hope).
Hubert.
Comment #8
sorenp commentedTwo hours of debugging yesterday night produced a little more info on the problem. As Patrik Nelson mentioned, the bug is related to the Write to Author setting and occures during the execution of
privatemsg_link. Also, the problem only appears when I'm logged in as$user->uid == 1and viewing nodes with$node->uid != 1.Best Regards,
Sören
Comment #9
thomherfs commentedIt's happening to me no matter what uid I'm using. I've tried it with users with different permission levels also. Still doesn't work. Anyone have any further information on how to solve this?
Comment #10
mjohnq3 commentedI receive the same error only for uid 1 with 4.7.0 beta 6 on Xammp 1.5.1 under Windows XP. Right now this is the only non core module installed. Disabling it eliminates the problem.
Comment #11
kus commentedthe same problem occurs with the buddy module v 1.57 , disabling helps.
Comment #12
ChrisKennedy commentedThe problem is on line 19:
Here is a quick fix that I think removes the error, although I'm not sure of the implications of this change:
PS: previewing this post did not show any preview - perhaps an error with drupal 4.7?
Comment #13
jmiccolis commentedchrisken I think you've found the right spot - but I've fixed it another way. It looks like the node object is being passed to the user_access() function, and it isn't to happy about it. So I've added some code to load the author of the node, and the pass that to user _load.
My privatemsg_link function looks like:
Comment #14
hadishon commentedI'll put my two cents into this. I don't have any kind of private messaging modules installed and I get these errors when I call cron.
Comment #15
hadishon commentedI started disabling modules to try to locate the source...
I found that I no longer get the errors when I disable the devel.module
Comment #16
revival commentedThanks jmiccolis --- that patch sorted it out nicely.
Comment #17
revival commentedI changed the patch to the one in post #12 ...
... but now users can't see the menu item that tells them how many private messages they have. Although it does appear when admin is logged in.
Any ideas how I can get this menu item back?
Comment #18
fool2 commentedRemove the line in privatemsg_menu() that says 'type'=>MENU_CALLBACK,
And it should work.
Comment #19
fool2 commentedOh, forgot, it's in the second menu item, around line 50
Comment #20
revival commentedSorry to be thick here, but which line should I comment out?
Comment #21
revival commentedI removed
but my users still can't see the menu item :(
Comment #22
lanesharon commentedI am getting this same errors in my 4.7 RC3, with no additional modules installed or configured (just core), when I navigate to:
administer -> comments -> configure tab
warning: array_keys(): The first argument should be an array in /myhome/me/public_html/gates-chili-high/modules/user.module on line 348.
warning: implode(): Bad arguments. in /myhome/me/public_html/gates-chili-high/modules/user.module on line 348.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /myhome/me/public_html/gates-chili-high/includes/database.mysql.inc on line 120.
Comment #23
droopy commentedI tried the fix suggested in #13 and this removed all the error messages from the front page. But now when I click on the username I get: warning: Attempt to assign property of non-object in D:\xampp\ost47\modules\privatemsg\privatemsg.module on line 264. The message function seems to work though.
Comment #24
killes@www.drop.org commentedI think the problem is that the handlng of roles in 4.7 has changed. in 4.7 users always have the "authenticated user" role, but it isn't saved in the database anymore. So you cannot assume that a user without $user->roles has no roles at all.
Comment #25
kchasney commentedHad the "p" "p" error and applied the patch. It worked but then I now receive the user.module error on line 348.
I see many many others have had this same problem for months. Is Privatemsg obsolete? Is there another module that does that same thing privatemsg does but w/o the errors? Tried both the 4.7 and cvs modules with and w/o patches. Nothing works and I kinda need this module. (maybe I should have stuck with 4.6)
Any help is appreciated.
Comment #26
dustyketchum commentedsee if modifying user.module helps as a workaround....i had nearly identical error messages under different circumstances...
see
http://drupal.org/node/63375
Comment #27
silurius commentedJust adding myself to the discussion for tracking. I'll happily do my best to help validate any patches.
Comment #28
mindless commentedPlease see fix/patch here.