Closed (fixed)
Project:
Drupal core
Component:
postgresql database
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Jan 2005 at 11:22 UTC
Updated:
13 Dec 2005 at 20:20 UTC
Jump to comment: Most recent file
In sess_read one tries to find in the session table the data belonging to the current session.
If no session is found, one insert a new row into the session table. The value inserted for the user ID is the value of $user->uid.
In PHP 5 this action gives the following error:
Notice: Trying to get property of non-object in \includes\session.inc on line 27.
As there's no session, we don't know who is the user, and the user to be noted in the insert is the anonymous user, number 0.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | postgres_session_inc.diff | 871 bytes | adrian |
| session.inc_1.patch | 1.01 KB | adschar |
Comments
Comment #1
killes@www.drop.org commentedI think the patch is reversed and needs to be applied with -R. It should be applied to 4.5 and HEAD.
Comment #2
dries commentedCommitted a slightly different fix to both HEAD and DRUPAL-4-5.
Comment #3
(not verified) commentedComment #4
adrian commentedThis patch breaks postgres.
The uid field is defined as not null, and hence leaving out the $user->uid in the insert statement causes update.php to not even load.
Attached is a 1 line patch with the user id column added back.
Comment #5
adschar commentedThis thread started when I noticed that in absence of a session, one does not have a user object. I tested in a PHP5 environment. There it noticed the non-object.
Adrian/Dries, is there any objection to hardcoding the value 0 when there's no session, and thus no user? That was the point of my original patch.
Comment #6
killes@www.drop.org commentedmoving to postgres, probably duplicate
Comment #7
Cvbge commentedThe value 0 is currently hardcoded, I haven't noticed any errors - thus marking as fixed.
Comment #8
(not verified) commented