Symfony Exception

UnrecognizedField

HTTP 500 Internal Server Error

Unrecognized field: publishedDate

Exception

Doctrine\ORM\Persisters\Exception\ UnrecognizedField

  1. final class UnrecognizedField extends PersisterException
  2. {
  3.     public static function byName(string $field): self
  4.     {
  5.         return new self(sprintf('Unrecognized field: %s'$field));
  6.     }
  7. }
  1.                 }
  2.                 continue;
  3.             }
  4.             throw UnrecognizedField::byName($fieldName);
  5.         }
  6.         return ' ORDER BY ' implode(', '$orderByList);
  7.     }
  1.         if (isset($assoc['orderBy'])) {
  2.             $orderBy $assoc['orderBy'];
  3.         }
  4.         if ($orderBy) {
  5.             $orderBySql $this->getOrderBySQL($orderBy$this->getSQLTableAlias($this->class->name));
  6.         }
  7.         $conditionSql $criteria instanceof Criteria
  8.             $this->getSelectConditionCriteriaSQL($criteria)
  9.             : $this->getSelectConditionSQL($criteria$assoc);
  1.      */
  2.     public function loadAll(array $criteria = [], ?array $orderBy null$limit null$offset null)
  3.     {
  4.         $this->switchPersisterContext($offset$limit);
  5.         $sql              $this->getSelectSQL($criterianullnull$limit$offset$orderBy);
  6.         [$params$types] = $this->expandParameters($criteria);
  7.         $stmt             $this->conn->executeQuery($sql$params$types);
  8.         $hydrator $this->em->newHydrator($this->currentPersisterContext->selectJoinSql Query::HYDRATE_OBJECT Query::HYDRATE_SIMPLEOBJECT);
  1.      */
  2.     public function findBy(array $criteria, ?array $orderBy null$limit null$offset null)
  3.     {
  4.         $persister $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
  5.         return $persister->loadAll($criteria$orderBy$limit$offset);
  6.     }
  7.     /**
  8.      * Finds a single entity by a set of criteria.
  9.      *
EntityRepository->findBy() in src/Controller/Front/BlogController.php (line 168)
  1.     #[Route('blog/tag/{word}'name'base_front_blog_noteslistwithkeyword')]
  2.     public function notesListWithKeywordAction(ManagerRegistry $doctrine$word)
  3.     {
  4.         $keywords $doctrine->getRepository(BlogKeyword::class)->findBy(
  5.             ['name' => $word],
  6.             ['publishedDate' => 'DESC']
  7.         );
  8.         $blogNotes $doctrine->getRepository(BlogNote::class)->findBlogPostsForKeyword($keywords);
  9.         $bestAuthors $doctrine->getRepository(BlogNote::class)->findMostPostedAuthors();
in vendor/symfony/http-kernel/HttpKernel.php -> notesListWithKeywordAction (line 163)
  1.         $this->dispatcher->dispatch($eventKernelEvents::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($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 29)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/adopt/web/adopciaki.pl/public_html/vendor/autoload_runtime.php') in public/index.php (line 6)
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\HttpFoundation\Request;
  4. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  5. return function (array $context) {
  6.     $request Request::createFromGlobals();
  7.     if($request->getClientIp() == "95.217.17.2") {

Logs

No log messages

Stack Trace

UnrecognizedField
Doctrine\ORM\Persisters\Exception\UnrecognizedField:
Unrecognized field: publishedDate

  at vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Exception/UnrecognizedField.php:15
  at Doctrine\ORM\Persisters\Exception\UnrecognizedField::byName()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:1202)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getOrderBySQL()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:1087)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getSelectSQL()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:914)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:225)
  at Doctrine\ORM\EntityRepository->findBy()
     (src/Controller/Front/BlogController.php:168)
  at App\Controller\Front\BlogController->notesListWithKeywordAction()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:184)
  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:29)
  at require_once('/home/adopt/web/adopciaki.pl/public_html/vendor/autoload_runtime.php')
     (public/index.php:6)