Exceptions
Exception
ErrorException
in
src/Service/Filter/Cats.php
(line 165)
public function getCatTreeWhere($start)
{
$cats = $this->cat_tree;
$i = 0;
if (count($cats[$start]) < 1) {
$q = "(cat = $start)";
} else {
$q = "(";
foreach ($cats[$start] as $k => $cat) {
if ($i++ > 0) {
$opt = $this->Auth->isOpt() ? 'opt' : '';
$where = "visible = 1 and (num > 0 or num2 > 0 or num3 > 0)";
if ($cat) {
$where .= " and ".$this->Cats->getCatTreeWhere($cat);
}
switch($spec) {
case 'new':
$where .= " and `new` = 1";
}
public function getProds(int $cat = 0, string $spec = '', string $search = ''): array
{
if (empty($this->prods)) {
return $this->getFromDb($cat, $spec, $search);
}
return $this->prods;
}
$results = $session->get('results') ?? 30;
$start = (int) $request->query->get('start');
$view_mode = $request->get('view') ?? $request->cookies->get('view_mode') ?? 'list';
$prods = $ModelProd->getProds($cat_id, $spec, $request->get('q', ''));
if ($spec) {
$page = $this->Pages->findOneBy(['intname' => 'catalog/' . $spec]);
} else {
$page = $this->Pages->findOneBy(['intname' => 'catalog']);
in
vendor/symfony/http-kernel/HttpKernel.php
->
prodList
(line 163)
$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 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
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/http-kernel/HttpCache/SubRequestHandler.php
->
handle
(line 86)
if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
}
try {
return $kernel->handle($request, $type, $catch);
} finally {
// restore global state
Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
}
}
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
::
handle
(line 457)
if ($this->surrogate) {
$this->surrogate->addSurrogateCapability($request);
}
// always a "master" request (as the real master request can be in cache)
$response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
/*
* Support stale-if-error given on Responses or as a config option.
* RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
* Cache-Control directives) that
in
vendor/symfony/framework-bundle/HttpCache/HttpCache.php
->
forward
(line 71)
protected function forward(Request $request, bool $catch = false, Response $entry = null): Response
{
$this->getKernel()->boot();
$this->getKernel()->getContainer()->set('cache', $this);
return parent::forward($request, $catch, $entry);
}
/**
* Returns an array of options to customize the Cache configuration.
*/
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
forward
(line 430)
// avoid that the backend sends no content
$subRequest->headers->remove('If-Modified-Since');
$subRequest->headers->remove('If-None-Match');
$response = $this->forward($subRequest, $catch);
if ($response->isCacheable()) {
$this->store($request, $response);
}
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
fetch
(line 328)
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
lookup
(line 212)
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MAIN_REQUEST === $type) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
{
if (!$this->booted) {
$container = $this->container ?? $this->preBoot();
if ($container->has('http_cache')) {
return $container->get('http_cache')->handle($request, $type, $catch);
}
}
$this->boot();
++$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 29)
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
require_once('/var/www/mixform/data/www/mixform.pl/vendor/autoload_runtime.php')
in
public/index.php
(line 4)
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
Stack Trace
ErrorException
|
---|
ErrorException: Warning: Undefined array key 438 at src/Service/Filter/Cats.php:165 at App\Service\Filter\Cats->getCatTreeWhere(438) (src/Service/Filter/Prods.php:56) at App\Service\Filter\Prods->getFromDb(438, '', null) (src/Service/Filter/Prods.php:164) at App\Service\Filter\Prods->getProds(438, '', '') (src/Controller/CatalogController.php:174) at App\Controller\CatalogController->prodList(object(Request), object(Session), object(Cat), object(Prods), 438, 'busini-steklyannie-pressovannie-crystal-art', '', '') (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(Kernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:457) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:71) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:430) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:328) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:212) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:193) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/var/www/mixform/data/www/mixform.pl/vendor/autoload_runtime.php') (public/index.php:4) |