Exceptions
Exception
TypeError
in
lib/boab/cms-bundle/src/Repository/ContentRepository.php
(line 135)
->where('c.slug = :slug')
->andWhere('c.status = :status')
->setParameter('slug',$slug)
->setParameter('status', Content::STATUS_PUBLISHED);
return $qb->getQuery()->getOneOrNullResult();
}
public function findContentByUserId($userId)
{
$qb = $this->getContentQuery()
ContentRepository->findContentBySlug()
in
lib/boab/cms-bundle/src/Manager/AbstractContentType.php
(line 72)
return $this->repository->findContentsByType($this->getEntityClass(), $page);
}
public function getContent(Request $request): ?ContentInterface
{
return $this->repository->findContentBySlug($request->get('slug'));
}
public function getContentById($contentId): ?ContentInterface
{
return $this->repository->findContentById($contentId);
AbstractContentType->getContent()
in
lib/boab/cms-bundle/src/Manager/ContentTypeManager.php
(line 103)
if(!$route instanceof RouteContentInterface){
throw new \Exception(sprintf('Your route must implements %s to call the method %s', RouteContentInterface::class, __METHOD__));
}
$typeManager = $this->getType($route->getContentType());
return $typeManager->getContent($request);
}
public function getContents(array $params)
{
return $this->contentRepository->findContents($params);
ContentTypeManager->getContent()
in
lib/boab/cms-bundle/src/Controller/ContentController.php
(line 81)
*
* @return void
*/
public function showAction(Request $request, RouteInterface $routeDocument, $contentTemplate)
{
$content = $this->contentTypeManager->getContent($request);
if(!$content){
throw new NotFoundHttpException('Page not found');
}
$view = $this->viewManager->load($contentTemplate);
in
vendor/symfony/http-kernel/HttpKernel.php
->
showAction
(line 152)
$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);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 74)
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $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) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
in
vendor/autoload_runtime.php
->
run
(line 35)
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
require_once('/home/u835281259/domains/heavenwavesmedia.com/siteFiles/vendor/autoload_runtime.php')
in
/home/u835281259/domains/heavenwavesmedia.com/public_html/index.php
(line 5)
<?php
use App\Kernel;
require_once dirname(__DIR__).'/siteFiles/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
Stack Trace
TypeError
|
---|
TypeError: Boab\CmsBundle\Repository\ContentRepository::findContentBySlug(): Return value must be of type Boab\CmsBundle\Entity\ContentInterface, null returned at lib/boab/cms-bundle/src/Repository/ContentRepository.php:135 at Boab\CmsBundle\Repository\ContentRepository->findContentBySlug() (lib/boab/cms-bundle/src/Manager/AbstractContentType.php:72) at Boab\CmsBundle\Manager\AbstractContentType->getContent() (lib/boab/cms-bundle/src/Manager/ContentTypeManager.php:103) at Boab\CmsBundle\Manager\ContentTypeManager->getContent() (lib/boab/cms-bundle/src/Controller/ContentController.php:81) at Boab\CmsBundle\Controller\ContentController->showAction() (vendor/symfony/http-kernel/HttpKernel.php:152) 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:202) 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:35) at require_once('/home/u835281259/domains/heavenwavesmedia.com/siteFiles/vendor/autoload_runtime.php') (/home/u835281259/domains/heavenwavesmedia.com/public_html/index.php:5) |