> -----Original Message-----
> From: bitweaver-core-bounces lists.sourceforge.net
[mailto:bitweaver-
> core-bounces lists.sourceforge.net] On Behalf Of
Christian Fowler
> Sent: 28 November 2007 17:33
> To: bitweaver-core lists.sourceforge.net
> Subject: Re: [bitweaver-core] R2 and MySql
>
>
> Yettyn,
>
> It looks like you removed the code that is likely
causing your bug:
>
> > * version $Revision: 1.164 $
> 298,301d297
> < // perhaps someone is importing
users and *knows* what
> they are doing
> < if( $this->verifyId(
$pParamHash['user_id'] ) ) {
> <
$pParamHash['user_store']['user_id'] =
> $pParamHash['user_id'];
> < }
You are probably right that the above code cause or should I
say reveals
this, but question is if it's not a bug. My reservations
though as I am not
familiar with all quirks of the code. But what happens is
this, in
BitUser::store
function store( &$pParamHash ) {
if( $this->verify( $pParamHash ) ) {
$this->mDb->StartTrans();
$pParamHash['content_type_guid'] =
BITUSER_CONTENT_TYPE_GUID;
if( !empty( $pParamHash['user_store'] ) &&
count(
$pParamHash['user_store'] ) ) {
if( $this->isValid() ) {
$userId = array ( "user_id" =>
$this->mUserId );
$result =
$this->mDb->associateUpdate(
BIT_DB_PREFIX.'users_users',
$pParamHash['user_store'], $userId );
} else {
if( empty(
$pParamHash['user_store']['user_id'] ) ) {
$pParamHash['user_store']['user_id'] =
$this->mDb->GenID(
'users_users_user_id_seq' );
As "$pParamHash['user_store']['user_id']" is
empty, which is correct as the
user doesn't exist yet, it call for next available id in the
sequence table
and this returns 2, I think it should return 1 as this is
the first user
added. As I see it the by me removed code
"covered" for this bug as
"pParamHash['user_store']['user_id']" there got
the value 1 from
"pParamHash['user_id']" and hence no longer empty
so no new id generated.
Now this may have be constructed intentionally by reason I
don't know, but
in such case it should have been stated more clearly in the
comment as this
more looks like a workaround for a breakage in the logic
somewhere.
I can put that code back in and make a proper comment to
solve the current
breakage, but question is if we shouldn't go for the real
bug as well,
although not necessarily now?
y
------------------------------------------------------------
-------------
SF.Net email is sponsored by: The Future of Linux Business
White Paper
from Novell. From the desktop to the data center, Linux is
going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
bitweaver-core mailing list
bitweaver-core lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitweave
r-core
|