Page MenuHomePhabricator

Unable to request user account with PostgreSQL
Closed, ResolvedPublic

Description

Author: rafaelhfaria

Description:
When a user request a new account, and error is reported from the DB:

"UserAccountRequest::insertOn"
23502: ERROR: null value in column "acr_id" violates not-null constraint DETAIL: Failing row contains (null, Test, Test User, test@mail.test, ab2f7606450e0725380dd6668ed3a172, 2013-05-04 12:00:58+00, null, 2013-04-04 12:00:58+00, Text ..., , , 192.168.0.1/32, , Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 ..., null, mediawiki:acctrequest:ip:192.168.0.1, 0, , f, null, null, null, ). ".

After looking in the "UserAccountRequest.php" file, and "public function insertOn()", I think that the problem is with this code:

$acr_id = is_null( $this->id )

? $this->id
: $dbw->nextSequenceValue( 'account_requests_acr_id_seq' );

If it is null, the code will use the NULL value, but if not, the code will use the next sequence.
After changing the code to:

$acr_id = !is_null( $this->id )

? $this->id
: $dbw->nextSequenceValue( 'account_requests_acr_id_seq' );

The user request account works as expected.


Version: REL1_20-branch
Severity: critical
OS: FreeBSD
Platform: Other

Details

Reference
bz46894

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:42 AM
bzimport set Reference to bz46894.
bzimport added a subscriber: Unknown Object (MLST).