mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Problem in prod mode - MappingException #7124
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maouache on GitHub (Mar 24, 2023).
Bug Report
Hello,
I had a weird problem, I created a symfony 6.2.7 project with the doctrine version here is the info:
I created my Person entity with
php bin/console make:entitywhich generated Personne.php (class Personne) and in doctrine table personne of course with the migration and all the steps.When I wanted to switch to prod mode: I got this error message:
It looks like doctrine is looking for a class called
'App\\Entity\\personne'when it's actually'App\\Entity\\Personne'.Temporary solution
For the moment I diverted that with a duplication of the file Personne.php and personne.php so that it works in both prod and dev mode. of in dev mode you don't need the duplication file.
Used but not working
I tried all the cache option delete:
The links of symfony for the deployment here they are all:
https://symfony.com/doc/current/deployment.html.
https://symfony.com/doc/3.4/setup/file_permissions.html
https://github.com/sonata-project/SonataAdminBundle/issues/5021
Where the error comes from ?
I think the problem comes from doctrine which converts 'Personne' into 'personne' when doctrine is in prod mode, so it triggers MappingException with the message
"App\Entity' does not exist"because there is not file calledpersonne.phpbutPersonne.phpexist.