Error 500 Internal Server Error

GET https://dev.la-boutique-francaise.vicstoryhub.fr/account/invoice/3

Exceptions

Variable "order" does not exist in invoice/index.html.twig at line 2.

Exception

Twig\Error\ RuntimeError

Show exception properties
Twig\Error\RuntimeError {#1785
  -lineno: 2
  -columnno: null
  -rawMessage: "Variable "order" does not exist."
  -source: Twig\Source {#1703
    -code: """
      PDF EXEMPLE\n
      N° de commande : {{ order.id }}
      """
    -name: "invoice/index.html.twig"
    -path: "/var/www/dev_la_boutique_francaise/templates/invoice/index.html.twig"
  }
  -phpFile: "/var/www/dev_la_boutique_francaise/var/cache/dev/twig/d1/d170121ea691246cce9336c2c29e9e2f.php"
  -phpLine: 56
}
  1. <!doctype html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Facture commande n° {{ order.id }}</title>
  6. <style>
in var/cache/dev/twig/d1/d170121ea691246cce9336c2c29e9e2f.php -> {closure:__TwigTemplate_84bc5fc8e7a1e801585b738188d69fcb::doDisplay():56} (line 56)
  1. // line 1
  2. yield "<!doctype html>
  3. <html lang=\"fr\">
  4. <head>
  5. <meta charset=\"utf-8\">
  6. <title>Facture commande n° ";
  7. // line 5
  8. yield (string) $this->escaper->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["order"]) || array_key_exists("order", $context) ? $context["order"] : (function () { throw new RuntimeError('Variable "order" does not exist.', 5, $this->source); })()), "id", [], "any", false, false, false, 5), "html", null, true);
  9. yield "</title>
in vendor/twig/twig/src/Template.php -> doDisplay (line 461)
  1. $context += $this->env->getGlobals();
  2. $blocks = array_merge($this->blocks, $blocks);
  3. try {
  4. $this->ensureSecurityChecked();
  5. yield from $this->doDisplay($context, $blocks);
  6. } catch (\Throwable $e) {
  7. $this->handleException($e);
  8. }
  9. }
  1. return $this->blocks;
  2. }
  3. public function display(array $context, array $blocks = []): void
  4. {
  5. foreach ($this->yield($context, $blocks) as $data) {
  6. echo $data;
  7. }
  8. }
  9. public function render(array $context): string
in vendor/twig/twig/src/Template.php -> display (line 431)
  1. ob_start();
  2. } else {
  3. ob_start(static 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. yield from $this->template->yieldBlock($name, $context + $this->env->getGlobals());
  2. }
  3. public function render(array $context = []): string
  4. {
  5. return $this->template->render($context);
  6. }
  7. public function display(array $context = []): void
  8. {
  9. // using func_get_args() allows to not expose the blocks argument
  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 = []): string
  5. {
  6. return $this->load($name)->render($context);
  7. }
  8. /**
  9. * Displays a template.
  10. *
  1. if (null !== $block) {
  2. return $this->container->get('twig')->load($view)->renderBlock($block, $parameters);
  3. }
  4. return $this->container->get('twig')->render($view, $parameters);
  5. }
  6. private function doRender(string $view, ?string $block, array $parameters, ?Response $response, string $method): Response
  7. {
  8. $content = $this->doRenderView($view, $block, $parameters, $method);
  1. *
  2. * Forms found in parameters are auto-cast to form views.
  3. */
  4. protected function renderView(string $view, array $parameters = []): string
  5. {
  6. return $this->doRenderView($view, null, $parameters, __FUNCTION__);
  7. }
  8. /**
  9. * Returns a rendered block from a view.
  10. *
AbstractController->renderView() in src/Controller/InvoiceController.php (line 36)
  1. if ($order->getUser() != $this->getUser()) {
  2. return $this->redirectToRoute('app_account');
  3. }
  4. $dompdf = new Dompdf();
  5. $html = $this->renderView('invoice/index.html.twig', [
  6. 'order' => $order
  7. ]);
  8. $dompdf->loadHtml($html);
  9. $dompdf->setPaper('A4', 'portrait');
  10. $dompdf->render();
  1. $this->dispatcher->dispatch($event, KernelEvents::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, $controllerMetadata);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type, $controllerMetadata);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. if (!$this->handlingHttpCache) {
  2. $this->resetServices = true;
  3. }
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. $response->send(false);
  7. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
  8. fastcgi_finish_request();
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/dev_la_boutique_francaise/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

Level Channel Message
INFO 19:56:35 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "0c72d5"
    },
    "request_uri": "https://dev.la-boutique-francaise.vicstoryhub.fr/_profiler/0c72d5?panel=exception&type=request",
    "method": "GET"
}
INFO 19:56:35 doctrine Connecting with parameters {params}
{
    "params": {
        "driver": "pdo_mysql",
        "idle_connection_ttl": 600,
        "host": "localhost",
        "port": 3306,
        "user": "dev_la_boutique_francaise",
        "password": "<redacted>",
        "driverOptions": [],
        "defaultTableOptions": [],
        "dbname": "db_dev_la_boutique_francaise",
        "serverVersion": "10.11.6-MariaDB",
        "charset": "utf8mb4"
    }
}
DEBUG 19:56:35 doctrine Executing query: SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3 FROM category t0
{
    "sql": "SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3 FROM category t0"
}

Stack Trace

RuntimeError
Twig\Error\RuntimeError:
Variable "order" does not exist in "invoice/index.html.twig" at line 2.

  at templates/invoice/index.html.twig:2
  at __TwigTemplate_84bc5fc8e7a1e801585b738188d69fcb->{closure:__TwigTemplate_84bc5fc8e7a1e801585b738188d69fcb::doDisplay():56}()
     (var/cache/dev/twig/d1/d170121ea691246cce9336c2c29e9e2f.php:56)
  at __TwigTemplate_84bc5fc8e7a1e801585b738188d69fcb->doDisplay()
     (vendor/twig/twig/src/Template.php:461)
  at Twig\Template->yield()
     (vendor/twig/twig/src/Template.php:416)
  at Twig\Template->display()
     (vendor/twig/twig/src/Template.php:431)
  at Twig\Template->render()
     (vendor/twig/twig/src/TemplateWrapper.php:53)
  at Twig\TemplateWrapper->render()
     (vendor/twig/twig/src/Environment.php:343)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:472)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRenderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:260)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (src/Controller/InvoiceController.php:36)
  at App\Controller\InvoiceController->index()
     (vendor/symfony/http-kernel/HttpKernel.php:190)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:143)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/var/www/dev_la_boutique_francaise/vendor/autoload_runtime.php')
     (public/index.php:5)