Skip to main content
Topic: [1.1.5] Registration failure (Read 1435 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[1.1.5] Registration failure

A particular person is always having the same issue with registration. They fill out the registration form, and submit, and get an error:

Wrong value type sent to the database. Integer expected. (id_member)

Re: [1.1.5] Registration failure

Reply #1
I laso have this error in elkarte log:

Code: [Select]
    Wrong value type sent to the database. Integer expected. (id_member)
    Function: accept
   /index.php?action=register;sa=register2
    File: /sources/subs/Agreement.class.php
    Line: 217
sorry for my bad english

Re: [1.1.5] Registration failure

Reply #2
I deactivated the error log. Too much messages.  O:-)

But I remember having members with the same issue.

Re: [1.1.5] Registration failure

Reply #3
Bugger!
Code: [Select]
		$memberID = registerMember($regOptions, 'register');

$lang = !empty($modSettings['userLanguage']) ? $modSettings['userLanguage'] : 'english';
$agreement = new Agreement($lang);
$agreement->accept($memberID, $user_info['ip'], empty($modSettings['agreementRevision']) ? strftime('%Y-%m-%d', forum_time(false)) : $modSettings['agreementRevision']);

if (!empty($modSettings['requirePrivacypolicy']))
{
$policy = new \PrivacyPolicy($lang);
$policy->accept($memberID, $user_info['ip'], empty($modSettings['privacypolicyRevision']) ? strftime('%Y-%m-%d', forum_time(false)) : $modSettings['privacypolicyRevision']);
}

// If there are "important" errors and you are not an admin: log the first error
// Otherwise grab all of them and don't log anything
if ($reg_errors->hasErrors(1) && !$user_info['is_admin'])
{
foreach ($reg_errors->prepareErrors(1) as $error)
throw new Elk_Exception($error, 'general');
}

// Was there actually an error of some kind dear boy?
if ($reg_errors->hasErrors())
{
$this->_req->post->step = 2;
$this->action_register();
return false;
}

// Do our spam protection now.
spamProtection('register');

// We'll do custom fields after as then we get to use the helper function!
if (!empty($this->_req->post->customfield))
{

should become:
Code: [Select]
		$memberID = registerMember($regOptions, 'register');

// If there are "important" errors and you are not an admin: log the first error
// Otherwise grab all of them and don't log anything
if ($reg_errors->hasErrors(1) && !$user_info['is_admin'])
{
foreach ($reg_errors->prepareErrors(1) as $error)
throw new Elk_Exception($error, 'general');
}

// Was there actually an error of some kind dear boy?
if ($reg_errors->hasErrors())
{
$this->_req->post->step = 2;
$this->action_register();
return false;
}

$lang = !empty($modSettings['userLanguage']) ? $modSettings['userLanguage'] : 'english';
$agreement = new Agreement($lang);
$agreement->accept($memberID, $user_info['ip'], empty($modSettings['agreementRevision']) ? strftime('%Y-%m-%d', forum_time(false)) : $modSettings['agreementRevision']);

if (!empty($modSettings['requirePrivacypolicy']))
{
$policy = new \PrivacyPolicy($lang);
$policy->accept($memberID, $user_info['ip'], empty($modSettings['privacypolicyRevision']) ? strftime('%Y-%m-%d', forum_time(false)) : $modSettings['privacypolicyRevision']);
}

// Do our spam protection now.
spamProtection('register');

// We'll do custom fields after as then we get to use the helper function!
if (!empty($this->_req->post->customfield))
{

Tracked at https://github.com/elkarte/Elkarte/issues/3278
Bugs creator.
Features destroyer.
Template killer.

Re: [1.1.5] Registration failure

Reply #4
@emanuele‍ I just cleaned the error log and did the edit mentioned above, I'll let you know in the next days if the error persist, thanks

p.s. the file to edit is /sources/controllers/Register.controller.php
sorry for my bad english

Re: [1.1.5] Registration failure

Reply #5
Yeah, I wasn't checking the errors log. The only reason I caught this was someone trying to register, and I had enabled the email contact form on the registration page.

(FYI: This person already had an account from 7 years ago, that hasn't been used since then, and they were trying to register a new account with the same email address. Duplicate accounts are against our user policy anyway, I've directed them to recover their original account.)

Re: [1.1.5] Registration failure

Reply #6
I tried it and now it seems to work

 

Re: [1.1.5] Registration failure

Reply #7
I also confirm, I didn't see anymore that error in the last 10 days.
sorry for my bad english