includes/sessions.php uses the "GENERAL_ERROR" error
code when a database error occurs. It should be using
CRITICAL_ERROR, since when message_die sees a
GENERAL_ERROR, it'll try to start a session before
returning the error, thereby causing the error
condition to happen again, which calls message_die
again, etc. It's particularly frustrating for the
user, since the problem becomes very difficult to debug.
Now, the error that was causing all this to be an issue
in the first place: sessions.php didn't know what to
insert into the phpbb_users.avatar_width and
avatar_height columns. I'm guessing that these were
placed there by a hack of some sort, and aren't there
in the standard distribution (I don't know -- it's not
my board, I was just called in to fix it). I made a
quick fix to sessions.php to insert 0 into both columns
but what should happen is that the columns should be
explicitly named in the query, like:
insert into phpbb_users (user_id, username, etc) values
('3', 'foo', 'etc')
Many phpbb hacks make slight changes to the phpbb_users
table (mostly, they add columns), and these hacks will
always break your stuff unless you do the insert as
I've explained above...
I've attached my sessions.php to this message. It
makes the first change outlined above, but doesn't take
care of the second one correctly (I'm in a hurry, and
figured it'd be better to submit a patch with the time
than to fix the bug on our installation only).
Thanks for putting the mod together, BTW. My friends
would be lost without it. :)
-Ian
postnuke/phpBB2 sessions.php
Logged In: YES
user_id=390332
I don't see listed for which version this patch applies.