Monday 05 January 2004 3:47:36 am
in kernel/classes/ezpreferences.php there is the following:
$existingRes = $db->arrayQuery( "SELECT * FROM ezpreferences WHERE user_id = $userID" );
if ( count( $existingRes ) > 0 )
[...] $query = "UPDATE ezpreferences SET value='$value' WHERE id = $prefID AND name='$name'"; Unless I'm being stupid here, my understanding of the function is as follows. If there is not setting for $name in the database then insert it, if it exists update it. So surely that select is incorrect because if you have any preferences for the current user then count($existingRes) will be > 0, although the pref you are trying to save may not exist in the db. Ultimately, this only allows one preference to ever be set?
|