PDA

View Full Version : Causes Database Error with vB 4.1.1 and aMember


crazyace
02-12-2011, 02:31 AM
We use aMember to handle all of our subs. After updating to 4.1.1 we started to have database issues for new users trying to log into the forums.


Database error in vBulletin 4.1.1:

Invalid SQL:

SELECT forum.forumid, forum.lastpost, forum.lastposter, forum.lastposterid, forum.lastthread, forum.lastthreadid, forum.lasticonid, forum.threadcount, forum.replycount, forum.lastpostid, forum.lastprefixid, user.usergroupid, user.homepage, user.options AS useroptions, IF(userlist.friend = 'yes', 1, 0) AS isfriend

FROM forum AS forum

LEFT JOIN user AS user ON (user.userid = forum.lastposterid)
LEFT JOIN userlist AS userlist ON (userlist.relationid = user.userid AND userlist.type = 'buddy' AND userlist.userid = );

MySQL Error : 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 6
Error Number : 1064
Request Date : Friday, February 11th 2011 @ 10:10:43 PM
Error Date : Friday, February 11th 2011 @ 10:10:43 PM
Script : http://www.probotters.com/forum/index.php
Referrer : http://www.probotters.com/forum/login.php?do=login
IP Address : 173.89.12.6
Username : dtestd
Classname : vB_Database
MySQL Version :
-->

As you can see the issue is with this part of the code

AND userlist.userid = ); where the = is empty. After disabling Project Tools it worked like a charm again. So any ideas on how to solve this issue would be wonderful.

PitchouneN64ngc
02-12-2011, 06:44 PM
The strange thing with this query is why vB devs are using $vbulletin->userinfo['userid'] and $userid which is the same value?

I'm trying to see where it happens but can't reproduce.

Can you try this:

- Activate Project Tools product
- Uncheck every plugin related to Project Tools
- Enable 1 plugin at each time and to go page to the problematic page to see if the problem occurs
- When the first issue appears, give me the name of the latest plugin you activated

Thanks :)

PS: seems to be similar than http://www.vb-os.com/project.php?issueid=163

--------------- Added 1297547374 at 1297547374 ---------------

I posted a patch in my latest link, can you try it?

As I can't reproduce the problem but it seems the origin is the same... Thank you :)

crazyace
02-15-2011, 02:07 PM
I'll try the patch and see what happens. I had disabled all of my plugings and when I enabled only Project tools, any members created via aMember would not log in. So I'll test and report back :)