PDA

View Full Version : [fixed] field2 rears its ugly head again


MINI2.com
Sun 18th Nov '01, 8:11pm
I'm getting an error when I click on the Forum Leaders link...it says:

Database error in vBulletin 2.2.1:

Invalid SQL:
SELECT
userfield.field2, forum.forumid, forum.title AS forumtitle,
user.username, user.userid, user.invisible, user.receivepm, user.lastactivity, user.lastvisit
FROM moderator
LEFT JOIN user ON (user.userid = moderator.userid)
LEFT JOIN forum ON (forum.forumid = moderator.forumid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
ORDER BY user.username ASC, forum.displayorder ASC

mysql error: Unknown column 'userfield.field2' in 'field list'

mysql error number: 1054

i'm assuming field2 they are looking for is Location which I had deleted all those and changed then added them back so location is actually now field9. What do I have to change and what other fields in other tables need to be modified to get this to work.

Thank you.

ps - everyone on my forum now agrees with me - vB ROCKS!

tubedogg
Sun 18th Nov '01, 9:01pm
It was a good idea to handle it this way unfortunately it is still buggy. :D

Yes this is a bug. I think I know the fix but I will let a dev give it to you so I don't screw it up. :D

Chen
Mon 19th Nov '01, 3:26am
In showgroups.php, change all instances of field2 to field9.
This includes some PHP code as well, not only in queries!

And that's it really.

tubedogg
Mon 19th Nov '01, 12:56pm
Actually what I would do is this (although don't take this as the official fix).

Change line 147 so that it reads
$DB_site->query_first
instead of
$DB_site->query

Change line 148 to this:
$fieldselect="userfield.field$field[profilefieldid],";

Change line 9 to
global $user, $sendpmlink, $onlinestatus, $showonline, $cookietimeout,$fieldselect,$field;

Change this (lines 13 to 17):
if ($user['field2'] == '') {
$user['location'] = " ";
} else {
$user['location'] = $user['field2'];
}to this
if ($fieldselect) {
if ($user['field$field[profilefieldid]'] == '') {
$user['location'] = " ";
} else {
$user['location'] = $user['field2'];
}
}

Again this is not the official fix but would work.