Error 500 Internal Server Error

GET https://staging.consentz.com/get_subtreatments/testclinic

Forwarded to ErrorController (021d3a)

Exceptions

The identifier id is missing for a query of App\Entity\Clinic\Stock\TreatmentClinic

Exception

Doctrine\ORM\Exception\ MissingIdentifierField

  1. final class MissingIdentifierField extends LogicException implements ManagerException
  2. {
  3. public static function fromFieldAndClass(string $fieldName, string $className): self
  4. {
  5. return new self(sprintf(
  6. 'The identifier %s is missing for a query of %s',
  7. $fieldName,
  8. $className,
  9. ));
  10. }
in vendor/doctrine/orm/src/EntityManager.php :: fromFieldAndClass (line 307)
  1. $sortedId = [];
  2. foreach ($class->identifier as $identifier) {
  3. if (! isset($id[$identifier])) {
  4. throw MissingIdentifierField::fromFieldAndClass($identifier, $class->name);
  5. }
  6. if ($id[$identifier] instanceof BackedEnum) {
  7. $sortedId[$identifier] = $id[$identifier]->value;
  8. } else {
  1. * @return object|null The entity instance or NULL if the entity can not be found.
  2. * @phpstan-return ?T
  3. */
  4. public function find(mixed $id, LockMode|int|null $lockMode = null, int|null $lockVersion = null): object|null
  5. {
  6. return $this->em->find($this->entityName, $id, $lockMode, $lockVersion);
  7. }
  8. /**
  9. * Finds all entities in the repository.
  10. *
EntityRepository->find() in src/Controller/PublicProfileController.php (line 629)
  1. #[Route(path: '/get_subtreatments/{subDomain}', name: 'get_subtreatments')]
  2. public function getSubTreatments(Request $request): Response
  3. {
  4. $treatmentId = $request->get('treatment');
  5. $em = $this->doctrine->getManager();
  6. $treatment = $em->getRepository(TreatmentClinic::class)->find($treatmentId);
  7. $query = $query = " SELECT * FROM price_list WHERE treatment_id = $treatmentId and availability_online = 1";
  8. $subTreatments = $em->getConnection()->executeQuery($query)->fetchAllAssociative();
  9. if ($subTreatments) {
  10. $html = $this->render('sub_treatments.html.twig', [
  11. 'subTreatments' => $subTreatments,
in vendor/symfony/http-kernel/HttpKernel.php -> getSubTreatments (line 183)
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $event);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. if (!$this->handlingHttpCache) {
  2. $this->resetServices = true;
  3. }
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/www/wwwroot/consentz/vendor/autoload_runtime.php') in public/index.php (line 4)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return static function (array $context) {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

Level Channel Message
INFO 00:58:47 deprecation Deprecated: App\EventListener\DoctrineExtensionSubscriber::__construct(): Optional parameter $blameableListener declared before required parameter $tokenStorage is implicitly treated as a required parameter
{
    "exception": {}
}
INFO 00:58:47 deprecation Deprecated: App\EventListener\RateLimitSubscriber::__construct(): Implicitly marking parameter $tokenStorage as nullable is deprecated, the explicit nullable type must be used instead
{
    "exception": {}
}
INFO 00:58:47 deprecation Deprecated: App\Service\RateLimiter\RateLimiterService::__construct(): Implicitly marking parameter $redis as nullable is deprecated, the explicit nullable type must be used instead
{
    "exception": {}
}
INFO 00:58:47 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "latest"
    },
    "request_uri": "https://staging.consentz.com/_profiler/latest?panel=exception&type=request",
    "method": "GET"
}

Stack Trace

MissingIdentifierField
Doctrine\ORM\Exception\MissingIdentifierField:
The identifier id is missing for a query of App\Entity\Clinic\Stock\TreatmentClinic

  at vendor/doctrine/orm/src/Exception/MissingIdentifierField.php:15
  at Doctrine\ORM\Exception\MissingIdentifierField::fromFieldAndClass()
     (vendor/doctrine/orm/src/EntityManager.php:307)
  at Doctrine\ORM\EntityManager->find()
     (vendor/doctrine/orm/src/EntityRepository.php:86)
  at Doctrine\ORM\EntityRepository->find()
     (src/Controller/PublicProfileController.php:629)
  at App\Controller\PublicProfileController->getSubTreatments()
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/www/wwwroot/consentz/vendor/autoload_runtime.php')
     (public/index.php:4)