Page 1 of 1

User entity class not exists

Posted: Sat Dec 02, 2023 2:04 am
by rob59m

I am an user of Phpmaker 2019 and, as I would like to upgrade to 2024 today and tried to convert an old project, named "Rep_Aeroclub".
I have a problem: if I select the authentication with static user levels (as it was in 2019) based on a "Users Table" named "vw_users" the project won't start with the following error after submitting the login form:

C:\xampp\htdocs\report\vendor\doctrine\persistence\src\Persistence\Mapping\MappingException.php(80): Class 'PHPMaker2024\Rep_Aeroclub\Entity\VwUser' does not exist

If I disable the authentication by Users Table the project starts ok and I see and use the menu of defined reports.
Actually the table "vw_users" is a view, I tried also to use a table, but the result is the same (obviously the non existent class in the error message changes to the name of the table)

Could somebody help me? Thanks!


Re: Class not exists after migration to phpmaker 2024

Posted: Sat Dec 02, 2023 9:31 am
by mobhar

You may try Dynamic User Level Security instead.


Re: User entity class not exists

Posted: Sat Dec 02, 2023 10:45 am
by arbei

Note that you still need to generate the entity class of the users table even you use Static User Levels, make sure you have checked the users table before generation. (Whether the users table is a table or a view is irrelevant.)


Re: User entity class not exists

Posted: Sun Dec 03, 2023 4:30 am
by rob59m

Thanks for the hints, I solved the problem (currently using version v2024.5).
The name of my view used for authentication was "vw_users", right clicking on the view and selecting "Object Properties" I noted that the Entity Class was "vw_user" (singular form of the table/view name), this is fine and corresponds to what stated in the documentation, but it seems that the generated php code in the authentication process looks for the wrong class name.
I just modified the view name from "vw_users" to "vw_user" (singular) and magically the generated code now works!


Re: User entity class not exists

Posted: Sun Dec 03, 2023 9:56 am
by arbei

rob59m wrote:

The name of my view used for authentication was "vw_users", right clicking on the view and selecting "Object Properties" I noted that the Entity Class was "vw_user" (singular form of the table/view name)...

I tried to test by creating a view named "vw_users" with SQL "SELECT * FROM employees" in demo project, the "Object Properties" shows the entity class is "VwUser" correctly (not "vw_user"), and the generated code runs fine.


Re: User entity class not exists

Posted: Sat May 25, 2024 11:54 pm
by philmills

I just had the same issue.
Brand new project with 2024.11 using dynamic user levels,.
'Entity\User' does not exist
My main users table is called "Users"
It maybe related to turning on username and password encryption, I turned it off and now the issue went away.
Testing further currently