Page 1 of 1
Reset Password Error - UpdateTable not found
Posted: Wed Apr 17, 2024 11:01 am
by JAYM
Reset Password Error
I have this reset password error after typing in the email then hit sent this error shows.
D:\xampp\htdocs\rfq\models\ResetPassword.php(348): Entity class for UpdateTable not found.
this is the line of ResetPassword.php
if ($this->UpdateTable != $this->TableName) { // Note: The username field name must be the same
$entityClass = GetEntityClass($this->UpdateTable);
if ($entityClass) {
$userRepository = GetUserEntityManager()->getRepository($entityClass);
} else {
throw new \Exception("Entity class for UpdateTable not found.");
}
} else {
$userRepository = GetUserRepository();
}
Please Help thank you!
Re: Reset Password Error
Posted: Wed Apr 17, 2024 1:10 pm
by JAYM
if i add MANUALLY on models/ResetPassword.php this line $this->UpdateTable = 'userlogin';
to ResetPassword.php it works
if ($action != "") {
$this->UpdateTable = 'userlogin'; //added code
if ($this->UpdateTable != $this->TableName) { // Note: The username field name must be the same
$entityClass = GetEntityClass($this->UpdateTable);
if ($entityClass) {
$userRepository = GetUserEntityManager()->getRepository($entityClass);
} else {
throw new \Exception("Entity class for UpdateTable not found.");
}
} else {
$userRepository = GetUserRepository();
}
where should i put this code $this->UpdateTable = 'userlogin';
on custom script so that it will detect the UpdateTable
Re: Reset Password Error
Posted: Wed Apr 17, 2024 2:47 pm
by arbei
If you use view as users table, you should use Page_Load server event to set UpdateTable
.
Re: Reset Password Error - UpdateTable not found
Posted: Wed Apr 17, 2024 4:18 pm
by JAYM
I dont use view as user table but I put this code to Change Password Page > Page_Load and Password Recovery Page > Page_Load and it works.
$table_name="userlogin";
$this->UpdateTable = $table_name;
Re: Reset Password Error - UpdateTable not found
Posted: Wed Apr 17, 2024 9:58 pm
by arbei
If your users table is a normal table, there is no need to set UpdateTable
at all because by default the UpdateTable
is same as the table name (e.g. userlogin
in your case). Since $this->UpdateTable == $this->TableName
by default, it will not try to find the entity class. You might have some server event which has changed UpdateTable
.