From 4c2129dc7e1d3bcaba044e267ba4c7bf5d0974a4 Mon Sep 17 00:00:00 2001 From: Lukas Mueller Date: Thu, 10 Nov 2022 03:58:59 -0500 Subject: [PATCH] fix return value for sp_login table. --- lib/CXGN/People/Login.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/CXGN/People/Login.pm b/lib/CXGN/People/Login.pm index a8fb861..81b59d1 100644 --- a/lib/CXGN/People/Login.pm +++ b/lib/CXGN/People/Login.pm @@ -178,7 +178,8 @@ sub store { # store updates the record if an id is defined, or inserts a new row if $id is undefined. my $self = shift; my $action = ''; - if ( $self->get_sp_person_id() ) { + my $person_id = $self->get_sp_person_id(); + if ( $person_id ) { $action = 'updated'; $self->get_dbh->do( <get_sql("insert"); $sth->execute( $un, $prive, $pende, $pwd, $cc, $dsa, $fn, $ln, $org ); - my $person_id = - $self->get_dbh()->last_insert_id( undef, 'sgn_people', 'sp_person', 'sp_person_id' ); + ($person_id) = $sth->fetchrow_array(); +# $self->get_dbh()->last_insert_id( undef, 'sgn_people', 'sp_person', 'sp_person_id' ); $self->{sp_person_id} = $person_id; print STDERR "NEW USER SP_PERSON_ID: ".$person_id."\n"; $self->add_role($self->get_user_type()); } - return 1; + return $person_id; } @@ -735,7 +736,7 @@ sub set_sql { last_name, organization ) - VALUES (?,?,?,crypt(?, gen_salt('bf')),?,?,?,?,?) + VALUES (?,?,?,crypt(?, gen_salt('bf')),?,?,?,?,?) RETURNING sp_person_id ", get_login => -- 2.11.4.GIT