if(preg_match('/\-([0-9]+)$/', $acSlug, $matches)) {
$mappingAc = $em
->createQueryBuilder()->select('o')
->from(MappingAc::class, 'o')
->where('o.originalUrl LIKE :idarticle')
->setParameter('idarticle', '%'.$matches[1])->getQuery()->getOneOrNullResult();
}
}
if($mappingAc) {
$nodeTransalation = $mappingAc->getNode()->getNodeTranslation('fr');
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['REMOTE_ADDR'] == '82.65.193.90');
//$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
NonUniqueResultException |
---|
Doctrine\ORM\NonUniqueResultException: More than one result was found for query although one row or none was expected. at vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:811 at Doctrine\ORM\AbstractQuery->getOneOrNullResult() (src/Controller/Front/ActionCollectiveArticleController.php:167) at App\Controller\Front\ActionCollectiveArticleController->redirectSubAc() (vendor/symfony/http-kernel/HttpKernel.php:158) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:80) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:201) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:25) |