Reset Password Error - UpdateTable not found

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
JAYM
User
Posts: 31

Reset Password Error - UpdateTable not found

Post 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!


JAYM
User
Posts: 31

Post 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


arbei
User
Posts: 9389

Post by arbei »

If you use view as users table, you should use Page_Load server event to set UpdateTable.


JAYM
User
Posts: 31

Post 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;


arbei
User
Posts: 9389

Post 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.


Post Reply