Thanks for this module. Looks really great. I"m trying to create a 24 hour crisis support line. So this is fantastic.
So, I've installed Skype Support Module, and it seems to be working OK, in terms of recognizing when people are online / on Skype, etc.. So that's really cool.
However, for some reason, when it is installed, I receive the following error when someone attempts to *register* as a new user on the system.
So here's the behavior:
(1) They're at the user/register page.
(2) They enter their information -- username, password, etc.
(3) They hit submit.
(4) They get this warning page.
Warning: array_keys(): The first argument should be an array in /home/ithou/public_html/modules/user.module on line 378
Warning: implode(): Bad arguments. in /home/ithou/public_html/modules/user.module on line 378
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: user_access SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/ithou/public_html/includes/database.mysql.inc on line 120
Warning: Cannot modify header information - headers already sent by (output started at /home/ithou/public_html/modules/user.module:378) in /home/ithou/public_html/includes/common.inc on line 266
(5) It looks like they've actually succesfully established an account, but the warning is strange.
(6) Note: This only happens, bizarrely, when skype support module is enabled.
(7) Note: There was a glitch like this re: a conflict between private message and user.module also, somehow, that got solved when you disable the "display private message link after each post" setting. [see also: http://drupal.org/node/50629 ]
The relevant line 378 in user.module is actually this line, [I added some stuff so that the line #'s are a bit off]:
if (!isset($perm[$account->uid])) {
$result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (%s)", implode(',', array_keys($account->roles)));
Any ideas?
I don't know if it matters that I'm using PHP4? rather than 5?
Thanks for your help.
Albert
www.ithou.org
Comments
Comment #1
Anonymous (not verified) commentedthanks for using the module :)
I think I know what this is.. I'm going to test my idea and I'll commit a fix soon.
Thanks for the well documented bug.
Comment #2
Anonymous (not verified) commentedok.. something commited.. leaving this open though for a reply on if it fixed it.
I did a quick test and didn't see the error. So more testing could be good. (making a patch was a waste of time for this)
Comment #3
ajwwong commentedWow. That's record turnaround time. :-)
I'll give this a shot and let you know how it goes!
Thanks.
Comment #4
Anonymous (not verified) commented:)
it was good timing.
Comment #5
ajwwong commentedRats... same error... Hmmm.....
[30 minutes later]
OK, so I've done some more testing. So.... I think I've narrowed it down to the function:
On my system it occurs *only* when... that function is present. [If I take that function out, registration goes on, without a hitch.]
Additionally, the problem seems to lie with the very first line of this function:
I say this because I observed the following:
(1) if I commented out just this line in the function, the registration worked fine -- without a hitch.
(2) Also: ***if I left this line in, but commented out *every other line* in the function -- I would *still* get the error as reported above. This leads me to believe very strongly that the bug is in this line.
I don't know enough to help here, but I think it's got to be something with this line.
Thanks for your help!
Albert
www.ithou.org
Comment #6
Anonymous (not verified) commentedinteresting.. well if you can, look more into it and attempt a patch for me.. I'll try again in a day.
Comment #7
ajwwong commentedI don't know if this messes other stuff up in the program, but the following modification works for me.
I looked at the error in the private message module that was causing a similar error response, and it seems like when user_access takes a second variable -- that's when the error starts to occur.
In private message:
Anyhow, I'll keep using it like this and let you know how it handles.
Best,
Albert
Comment #8
Anonymous (not verified) commentedfix commited.
thanks for your help.
Your fix wasn't really the right fix, but it showed me the right way. If you review the skypesupport_user() you'll see what I did.
Comment #9
ajwwong commentedPerfect! Works like a charm!
Thanks a bunch.... :-)
Albert
Comment #10
Anonymous (not verified) commentedi may have just noticed another bug.. with the support user list getting broken.
test that for me if you can..
also, i'm adding in the ability to display the user's language incase of sites like drupal.org that support many languages.
I will commit that in a bit.
Comment #11
Anonymous (not verified) commentedmight be a user.module bug but im leaving this open as it is returned due to the way I have to keep the logic in there.
Comment #12
ajwwong commentedHi Steve,
Glad to test stuff out....
Can't seem to see the breaking of the support user list you mentioned, ... at least so far... seems to work, but if I find this happening I'll let you know... [I'm only 1 user and I can't get Skype happening on 2 machines... yet :-) ]
Albert
Comment #13
ajwwong commentedHey, there... just fyi,
the 1.9 version doesn't work for me again (same error messages as above when new user attempts to register.) However, 1.8 does work just fine.... I think it's the second variable in user_access which was added back in.... don't know why this is happening.... I tried logging it as an issue with user_access, but was told user_access is fine.
Oh well... I'll just stick with 1.8 for now! ;_)
best,
Albert
Comment #14
Carlos Miranda Levy commentedSame problem here.
Using Drupal 4.7.1
Where can I get v1.8?
Comment #15
Carlos Miranda Levy commentedv1.8 is available at:
http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/modules/sk...
Upon uploading this file on top of v1.9 problem was solved.
Comment #16
Anonymous (not verified) commentedIt may not show the error in 1.8 but it's not really doing the check like it is suppose to. Example what I mean..
If you are an admin that has control to change other users profiles, if you go to another users profile, the added skype fields may not appear for you on that other users profiles