{% if winery.addressZip %}<meta itemprop="postalCode" content="{{ winery.addressZip }}" />{% endif %}
{% if winery.addressCountry %}<meta itemprop="addressCountry" content="{{ winery.addressCountry.iso }}" />{% endif %}
<iframe loading="lazy" title="{{ 'winery_location' | trans({'%winery%': winery.name}, "winedexer", language) }}" src="https://www.google.com/maps/embed/v1/place?&zoom=8&maptype=satellite&key=AIzaSyBfVEdM-gypd9wdSqX4jrt8_w6HYrcH2JM&q={{ wineData.location.latitude }},{{ wineData.location.longitude }}" allowfullscreen></iframe>
{% elseif winery.addressAddress and winery.addressCity and winery.addressZip %}
<iframe loading="lazy" title="{{ 'winery_location' | trans({'%winery%': winery.name}, "winedexer", language) }}" src="https://www.google.com/maps/embed/v1/place?&zoom=8&maptype=satellite&key=AIzaSyBfVEdM-gypd9wdSqX4jrt8_w6HYrcH2JM&q={{ winery.addressAddress }}, {{ winery.addressZip }} {{ winery.addressCity }},{{ winery.addressCountry.name }}" allowfullscreen></iframe>
{% elseif winery.addressRegion.mainRegion and winery.addressRegion and winery.addressCountry %}
<iframe loading="lazy" title="{{ 'winery_location' | trans({'%winery%': winery.name}, "winedexer", language) }}" src="https://www.google.com/maps/embed/v1/search?&zoom=9&maptype=satellite&key=AIzaSyBfVEdM-gypd9wdSqX4jrt8_w6HYrcH2JM&q={% if winery.addressRegion.mainRegion != winery.addressRegion %}{{ winery.addressRegion.name }}, {% endif %}{{ winery.addressRegion.mainRegion.name }},{{ winery.addressCountry.name }}" allowfullscreen></iframe>
{% endif %}
echo ",";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 14, $this->source); })()), "addressCountry", [], "any", false, false, false, 14), "name", [], "any", false, false, false, 14), "html", null, true);
echo "\" allowfullscreen></iframe>
";
} elseif (((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 15
(isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 15, $this->source); })()), "addressRegion", [], "any", false, false, false, 15), "mainRegion", [], "any", false, false, false, 15) && twig_get_attribute($this->env, $this->source, (isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 15, $this->source); })()), "addressRegion", [], "any", false, false, false, 15)) && twig_get_attribute($this->env, $this->source, (isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 15, $this->source); })()), "addressCountry", [], "any", false, false, false, 15))) {
// line 16
echo "\t<iframe loading=\"lazy\" title=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("winery_location", ["%winery%" => twig_get_attribute($this->env, $this->source, (isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 16, $this->source); })()), "name", [], "any", false, false, false, 16)], "winedexer", (isset($context["language"]) || array_key_exists("language", $context) ? $context["language"] : (function () { throw new RuntimeError('Variable "language" does not exist.', 16, $this->source); })())), "html", null, true);
echo "\" src=\"https://www.google.com/maps/embed/v1/search?&zoom=9&maptype=satellite&key=AIzaSyBfVEdM-gypd9wdSqX4jrt8_w6HYrcH2JM&q=";
if ((0 !== twig_compare(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 16, $this->source); })()), "addressRegion", [], "any", false, false, false, 16), "mainRegion", [], "any", false, false, false, 16), twig_get_attribute($this->env, $this->source, (isset($context["winery"]) || array_key_exists("winery", $context) ? $context["winery"] : (function () { throw new RuntimeError('Variable "winery" does not exist.', 16, $this->source); })()), "addressRegion", [], "any", false, false, false, 16)))) {
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
</p>
</div>
<div class=\"col-12 col-lg-8\">
";
// line 445
$this->loadTemplate("shop/single/map.html.twig", "shop/wine.html.twig", 445)->display(twig_array_merge($context, ["winery" => twig_get_attribute($this->env, $this->source, (isset($context["wine"]) || array_key_exists("wine", $context) ? $context["wine"] : (function () { throw new RuntimeError('Variable "wine" does not exist.', 445, $this->source); })()), "winery", [], "any", false, false, false, 445), "wineData" => (isset($context["wineData"]) || array_key_exists("wineData", $context) ? $context["wineData"] : (function () { throw new RuntimeError('Variable "wineData" does not exist.', 445, $this->source); })())]));
// line 446
echo " </div>
</div>
</div>
<div id=\"wine-top\" class=\"container-fluid\" style=\"background-image: url('/image/region/";
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
public function render(array $context = []): string
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_get_args()[1] ?? []);
}
public function display(array $context = [])
{
// using func_get_args() allows to not expose the blocks argument
* @throws SyntaxError When an error occurred during compilation
* @throws RuntimeError When an error occurred during rendering
*/
public function render($name, array $context = []): string
{
return $this->load($name)->render($context);
}
/**
* Displays a template.
*
{
if (!$this->container->has('twig')) {
throw new \LogicException('You can not use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
}
return $this->container->get('twig')->render($view, $parameters);
}
/**
* Renders a view.
*/
'structure' => $structure,
'descriptions' => $desc,
'description' => $description,
'metas' => $metas,
'news' => $news,
'server' => $_ENV['PROJECT_VNK_SERVER_URL'],
)
)),
);
});
if ($locked || !$wouldBlock) {
$logger && $logger->info(sprintf('Lock %s, now computing item "{key}"', $locked ? 'acquired' : 'not supported'), ['key' => $item->getKey()]);
self::$lockedFiles[$key] = true;
$value = $callback($item, $save);
if ($save) {
if ($setMetadata) {
$setMetadata($item);
}
}
try {
$value = ($this->callbackWrapper)($callback, $item, $save, $pool, function (CacheItem $item) use ($setMetadata, $startTime, &$metadata) {
$setMetadata($item, $startTime, $metadata);
}, $this->logger ?? null);
$setMetadata($item, $startTime, $metadata);
return $value;
} finally {
unset($this->computing[$key]);
}
}
if ($recompute) {
$save = true;
$item->set($callback($item, $save));
if ($save) {
$pool->save($item);
}
}
return $value;
} finally {
unset($this->computing[$key]);
}
}, $beta, $metadata, $this->logger ?? null);
}
}
*
* @return mixed
*/
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
/**
* {@inheritdoc}
*/
'news' => $news,
'server' => $_ENV['PROJECT_VNK_SERVER_URL'],
)
)),
);
});
$langs = $this->utilsController->getAvailableLanguages();
if (empty($body['metas']['url']) || !is_array($body['metas']['url']) || count($body['metas']['url']) < count($langs)) {
$winery = $this->scrapWineryRepository->findOneBy(array('url' => $wineryPath));
if (empty($winery)) {
$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, 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) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$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);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?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']);
};
No log messages
RuntimeError
|
---|
Twig\Error\RuntimeError: Impossible to access an attribute ("mainRegion") on a null variable. at templates/shop/single/map.html.twig:15 at twig_get_attribute() (var/cache/prod/twig/32/32bbd2149c546c4244039251aaebada420a09a761ee6ccd59ae6b81987fea38a.php:137) at __TwigTemplate_697c8d16c7b8f1ec981098eff88c2b71a9a2cdd098048203b310408e35e74020->doDisplay() (vendor/twig/twig/src/Template.php:394) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:367) at Twig\Template->display() (var/cache/prod/twig/b1/b12cc39e24bb6b648143abf9571fd46fb1303ba84c27263539a1d190d7cd2e75.php:1370) at __TwigTemplate_6b8c50f4b3ee837e2b0d75436332bdf6f6c565b9f86818d05bc57462c92709c1->doDisplay() (vendor/twig/twig/src/Template.php:394) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:367) at Twig\Template->display() (vendor/twig/twig/src/Template.php:379) at Twig\Template->render() (vendor/twig/twig/src/TemplateWrapper.php:40) at Twig\TemplateWrapper->render() (vendor/twig/twig/src/Environment.php:280) at Twig\Environment->render() (vendor/symfony/framework-bundle/Controller/AbstractController.php:251) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView() (src/Controller/Vinotek/WineController.php:432) at App\Controller\Vinotek\WineController->App\Controller\Vinotek\{closure}() (vendor/symfony/cache/LockRegistry.php:105) at Symfony\Component\Cache\LockRegistry::compute() (vendor/symfony/cache/Traits/ContractsTrait.php:100) at Symfony\Component\Cache\Adapter\AbstractAdapter->Symfony\Component\Cache\Traits\{closure}() (vendor/symfony/cache-contracts/CacheTrait.php:72) at Symfony\Component\Cache\Adapter\AbstractAdapter->doGet() (vendor/symfony/cache/Traits/ContractsTrait.php:107) at Symfony\Component\Cache\Adapter\AbstractAdapter->doGet() (vendor/symfony/cache-contracts/CacheTrait.php:35) at Symfony\Component\Cache\Adapter\AbstractAdapter->get() (src/Controller/Vinotek/WineController.php:436) at App\Controller\Vinotek\WineController->wineAction() (vendor/symfony/http-kernel/HttpKernel.php:156) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:78) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:199) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:37) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/var/www/winemakers/wine-makers-core/vendor/autoload_runtime.php') (public/index.php:5) |