Describe the bug
The requirements option in an AdminRoute seems to be evaluated after fetching the entity from the database (or not all all).
This works in Symfony:
- When I request /admin/dashboard/preview/foo -> I get a 404
#[Route(path: '/admin/dashboard/preview/{entityId}', name: 'preview', requirements: ['entityId' => Requirement::UUID_V7])]
public function preview(): Response
{
When I am using AdminRoute:
#[AdminRoute(path: '/preview/{entityId}', name: 'preview', options: ['requirements' => ['entityId' => Requirement::UUID_V7]])]
public function preview(AdminContext $context): Response
- When I request /admin/dashboard/preview/foo -> I get
Doctrine\DBAL\Types\ConversionException:
Could not convert database value "foo" to Doctrine Type uuid
To Reproduce
- Create an
AdminRoute with a requirements option.
(OPTIONAL) Additional context
- I would expect the
requirements array to be evaluated before, the Entity is fetched from the database.
Describe the bug
The requirements option in an
AdminRouteseems to be evaluated after fetching the entity from the database (or not all all).This works in Symfony:
When I am using
AdminRoute:To Reproduce
AdminRoutewith a requirements option.(OPTIONAL) Additional context
requirementsarray to be evaluated before, the Entity is fetched from the database.