User entity class not exists

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

User entity class not exists

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


mobhar
User
Posts: 11790

Post by mobhar »

You may try Dynamic User Level Security instead.


arbei
User
Posts: 9504

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


rob59m
User
Posts: 3

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


arbei
User
Posts: 9504

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


philmills
User
Posts: 569

Post 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


Post Reply