-
richb201
Posting Freak
-
Posts: 1,004
Threads: 300
Joined: Sep 2017
Reputation:
0
06-16-2018, 12:55 AM
(This post was last modified: 06-16-2018, 01:43 AM by richb201.)
I went back to putting Community Auth in my code. I am again having a problem with the table called "users" when running create_user. I have tracked the problem down to Form_validation.php. Just to remind you, I changed the sql script to create a community auth table called users2 instead of users and also put this line in my config/db_tables
// USER RELATED TABLES
$config['user_table'] = 'users2';
Yet, when executing the validation routine, _execute, and running this line:
$this->_execute($row, $row['rules'], $row['postdata']);
$row['rules] is "is_unique[users.username]" . Shouldn't this be users2.username ??
I narrowed this down to the validation_rules in Examples.php
'field' => 'email',
'label' => 'email',
'rules' => 'trim|required|valid_email|is_unique[' . db_table('user_table') . '.email]', <<<this line
'errors' => [
'is_unique' => 'Email address already in use.'
]
.db_table('user_table') is inserting 'users' instead of 'users2". why would this be if $config['user_table'] is being set to 'users2'? Is there any additional configuration I need to do?
proof that an old dog can learn new tricks
-
skunkbad
Senior Citizen
-
Posts: 1,300
Threads: 63
Joined: Oct 2014
Reputation:
86
(06-16-2018, 12:55 AM)richb201 Wrote: I went back to putting Community Auth in my code. I am again having a problem with the table called "users" when running create_user. I have tracked the problem down to Form_validation.php. Just to remind you, I changed the sql script to create a community auth table called users2 instead of users and also put this line in my config/db_tables
// USER RELATED TABLES
$config['user_table'] = 'users2';
Yet, when executing the validation routine, _execute, and running this line:
$this->_execute($row, $row['rules'], $row['postdata']);
$row['rules] is "is_unique[users.username]" . Shouldn't this be users2.username ??
I narrowed this down to the validation_rules in Examples.php
'field' => 'email',
'label' => 'email',
'rules' => 'trim|required|valid_email|is_unique[' . db_table('user_table') . '.email]', <<<this line
'errors' => [
'is_unique' => 'Email address already in use.'
]
.db_table('user_table') is inserting 'users' instead of 'users2". why would this be if $config['user_table'] is being set to 'users2'? Is there any additional configuration I need to do?
My guess is that you've somehow botched the install.
|