https://ichiro-sai.com/sitemap.xml

Exceptions

Impossible to access an attribute ("update_date") on a null variable.

  • Exception
  • Logs
  • Stack Trace

Twig\Error\ RuntimeError

  1.         <loc>{{url('sitemap_page_xml')}}</loc>
  2.         <lastmod>{{Page.update_date|date_format('','c')}}</lastmod>
  3.     </sitemap>
  4.     <sitemap>
  5.         <loc>{{url('sitemap_category_xml')}}</loc>
  6.         <lastmod>{{Category.update_date|date_format('','c')}}</lastmod>
  7.     </sitemap>
  8.     {% for p in 1..productPageCount %}
  9.         <sitemap>
  10.             <loc>{{url('sitemap_product_xml', {page: p})}}</loc>
  11.             <lastmod>{{Product.update_date|date_format('','c')}}</lastmod>
  1.         // line 8
  2.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sitemap_category_xml");
  3.         echo "</loc>
  4.         <lastmod>";
  5.         // line 9
  6.         echo twig_escape_filter($this->env$this->extensions['Eccube\Twig\Extension\EccubeExtension']->getDateFormatFilter(twig_get_attribute($this->env$this->source, (isset($context["Category"]) || array_key_exists("Category"$context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.'9$this->source); })()), "update_date", [], "any"falsefalsefalse9), """c"), "html"nulltrue);
  7.         echo "</lastmod>
  8.     </sitemap>
  9.     ";
  10.         // line 11
  11.         $context['_parent'] = $context;
in vendor/twig/twig/src/Template.php -> doDisplay (line 405)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 378)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
Template->display(array('Category' => null, 'Product' => object(Product), 'productPageCount' => 1, 'Page' => object(Page)), array()) in src/Eccube/Twig/Template.php (line 41)
  1.             $eventDispatcher->dispatch($event$this->getTemplateName());
  2.             if ($event->getSource() !== $originCode) {
  3.                 $newTemplate $this->env->createTemplate($event->getSource());
  4.                 $newTemplate->display($event->getParameters(), $blocks);
  5.             } else {
  6.                 parent::display($event->getParameters(), $blocks);
  7.             }
  8.         } else {
  9.             parent::display($context$blocks);
  10.         }
  11.     }
in vendor/twig/twig/src/Template.php -> display (line 390)
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context, \func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     {
  2.         if (!$this->container->has('twig')) {
  3.             throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
  4.         }
  5.         return $this->container->get('twig')->render($view$parameters);
  6.     }
  7.     /**
  8.      * Renders a view.
  9.      */
  1.     /**
  2.      * Renders a view.
  3.      */
  4.     protected function render(string $view, array $parameters = [], Response $response null): Response
  5.     {
  6.         $content $this->renderView($view$parameters);
  7.         if (null === $response) {
  8.             $response = new Response();
  9.         }
AbstractController->render('sitemap_index.xml.twig', array('Category' => null, 'Product' => object(Product), 'productPageCount' => 1, 'Page' => object(Page)), object(Response)) in src/Eccube/Controller/SitemapController.php (line 221)
  1.     {
  2.         $response = new Response();
  3.         $response->headers->set('Content-Type''application/xml'); // Content-Typeを設定
  4.         return $this->render(
  5.             $template_name,
  6.             $data,
  7.             $response
  8.         );
  9.     }
  10. }
SitemapController->outputXml(array('Category' => null, 'Product' => object(Product), 'productPageCount' => 1, 'Page' => object(Page)), 'sitemap_index.xml.twig') in src/Eccube/Controller/SitemapController.php (line 121)
  1.                 'Category' => $Category,
  2.                 'Product' => $Product,
  3.                 'productPageCount' => $paginationData['pageCount'],
  4.                 'Page' => $Page,
  5.             ],
  6.             'sitemap_index.xml.twig'
  7.         );
  8.     }
  9.     /**
  10.      * Output sitemap of product categories
  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);
  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 (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  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.     }
Kernel->handle(object(Request)) in index.php/ (line 83)
  1.         }
  2.     }
  3. }
  4. $kernel = new Kernel($env$debug);
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);