You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Creating a new entity via the action Action::SAVE_AND_CONTINUE we get the following TypeError
TypeError:
App\Entity\MyEntity::getId(): Return value must be of type int, null returned
at App\Entity\MyEntity->getId()
(/var/www/html/vendor/symfony/property-access/PropertyAccessor.php:401)
at Symfony\Component\PropertyAccess\PropertyAccessor->readProperty(array(object(MyEntity)), 'id', false)
(/var/www/html/vendor/symfony/property-access/PropertyAccessor.php:102)
at Symfony\Component\PropertyAccess\PropertyAccessor->getValue(object(MyEntity), 'id')
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Dto/EntityDto.php:106)
at EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto->getPrimaryKeyValue()
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Dto/EntityDto.php:113)
at EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto->getPrimaryKeyValueAsString()
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Factory/ActionFactory.php:203)
at EasyCorp\Bundle\EasyAdminBundle\Factory\ActionFactory->generateActionUrl(object(Request), object(ActionDto), object(EntityDto))
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Factory/ActionFactory.php:146)
at EasyCorp\Bundle\EasyAdminBundle\Factory\ActionFactory->processAction('new', object(ActionDto), object(EntityDto))
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Factory/ActionFactory.php:73)
at EasyCorp\Bundle\EasyAdminBundle\Factory\ActionFactory->processEntityActions(object(EntityDto), object(ActionConfigDto))
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Factory/EntityFactory.php:56)
at EasyCorp\Bundle\EasyAdminBundle\Factory\EntityFactory->processActions(object(EntityDto), object(ActionConfigDto))
(/var/www/html/vendor/easycorp/easyadmin-bundle/src/Controller/AbstractCrudController.php:303)
at EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController->new(object(AdminContext))
(/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:183)
To Reproduce
We are using EasyAdmin v4.12.0.
This issue can be reproduced when creating a CRUD page with the following actions:
Describe the bug
Creating a new entity via the action
Action::SAVE_AND_CONTINUE
we get the following TypeErrorTo Reproduce
We are using EasyAdmin v4.12.0.
This issue can be reproduced when creating a CRUD page with the following actions:
for an enitty with a non-nullable ID:
(OPTIONAL) Additional context
Related code: https://github.com/EasyCorp/EasyAdminBundle/blame/4.x/src/Factory/ActionFactory.php#L203
Possibly related PRs:
The text was updated successfully, but these errors were encountered: