Skip to content

Error 500 when viewing a report with Page hits datasource and added graphs #13485

Closed
@magdalenaleonow

Description

Mautic Version

5.0.x series

Way of installing

Other (please specify if relevant in the bug report)

PHP version

8.2.4

What browsers are you seeing the problem on?

Not relevant

What happened?

In a report with Data Source: Page hits and added Graph: Most unique visits (Table) or Most visited pages (Table) error 500 if you try to view the report:
500 Internal Server Error - An exception has been thrown during the rendering of a template ("Mautic\CoreBundle\Twig\Extension\AssetExtension::makeLinks(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code on line 130").
image

How can we reproduce this issue?

1: Create a report
2: Choose data source "Page hits"
3: In the Graphs tab, add "Most unique visits" or " Most visited pages"
4: Save&Close or Save and view report - error 500

Relevant log output

[2024-02-28T08:59:25.196771+00:00] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Mautic\CoreBundle\Twig\Extension\AssetExtension::makeLinks(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code on line 130")." at /var/www/html/app/bundles/ReportBundle/Resources/views/Graph/Table.html.twig line 37 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Mautic\\CoreBundle\\Twig\\Extension\\AssetExtension::makeLinks(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code on line 130\"). at /var/www/html/app/bundles/ReportBundle/Resources/views/Graph/Table.html.twig:37)
[stacktrace]
#0 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#1 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#2 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#3 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1347): Twig\\TemplateWrapper->render(Array)
#4 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(76): twig_include(Object(Twig\\Environment), Array, '@MauticReport/G...', Array)
#5 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_750277c492691af516671fa9a7454582->doDisplay(Array, Array)
#6 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#7 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#8 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#9 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1347): Twig\\TemplateWrapper->render(Array)
#10 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(61): twig_include(Object(Twig\\Environment), Array, '@MauticReport/R...', Array, false)
#11 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_a9c7c3e888311bcb0ffe0568097e5fbf->doDisplay(Array, Array)
#12 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#13 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#14 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#15 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1347): Twig\\TemplateWrapper->render(Array)
#16 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(198): twig_include(Object(Twig\\Environment), Array, '@MauticReport/R...')
#17 /var/www/html/vendor/twig/twig/src/Template.php(171): __TwigTemplate_d87c2908016285a2371406ca5f223443->block_content(Array, Array)
#18 /var/www/html/vendor/twig/twig/src/Template.php(243): Twig\\Template->displayBlock('content', Array, Array, true)
#19 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(66): Twig\\Template->renderBlock('content', Array, Array)
#20 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_274f4d32b0e34e384411d368c6082172->doDisplay(Array, Array)
#21 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#22 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(56): Twig\\Template->display(Array, Array)
#23 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_d87c2908016285a2371406ca5f223443->doDisplay(Array, Array)
#24 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#25 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#26 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#27 /var/www/html/vendor/twig/twig/src/Environment.php(280): Twig\\TemplateWrapper->render(Array)
#28 /var/www/html/vendor/symfony/framework-bundle/Controller/AbstractController.php(258): Twig\\Environment->render('@MauticReport/R...', Array)
#29 /var/www/html/vendor/symfony/framework-bundle/Controller/AbstractController.php(266): Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->renderView('@MauticReport/R...', Array)
#30 /var/www/html/app/bundles/CoreBundle/Controller/CommonController.php(178): Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->render('@MauticReport/R...', Array, Object(Symfony\\Component\\HttpFoundation\\Response))
#31 /var/www/html/app/bundles/ReportBundle/Controller/ReportController.php(651): Mautic\\CoreBundle\\Controller\\CommonController->delegateView(Array)
#32 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(163): Mautic\\ReportBundle\\Controller\\ReportController->viewAction(Object(Symfony\\Component\\HttpFoundation\\Request), '15', 1)
#33 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(75): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#34 /var/www/html/vendor/symfony/http-kernel/Kernel.php(202): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#35 /var/www/html/app/AppKernel.php(109): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#36 /var/www/html/app/middlewares/CORSMiddleware.php(76): AppKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#37 /var/www/html/app/middlewares/HSTSMiddleware.php(39): Mautic\\Middleware\\CORSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#38 /var/www/html/app/middlewares/CatchExceptionMiddleware.php(28): Mautic\\Middleware\\HSTSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#39 /var/www/html/app/middlewares/Dev/IpRestrictMiddleware.php(52): Mautic\\Middleware\\CatchExceptionMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#40 /var/www/html/app/middlewares/VersionCheckMiddleware.php(58): Mautic\\Middleware\\Dev\\IpRestrictMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#41 /var/www/html/app/middlewares/TrustMiddleware.php(42): Mautic\\Middleware\\VersionCheckMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#42 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Mautic\\Middleware\\TrustMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#43 /var/www/html/index.php(19): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
#44 {main}

[previous exception] [object] (TypeError(code: 0): Mautic\\CoreBundle\\Twig\\Extension\\AssetExtension::makeLinks(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code on line 130 at /var/www/html/app/bundles/CoreBundle/Twig/Extension/AssetExtension.php:166)
[stacktrace]
#0 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(130): Mautic\\CoreBundle\\Twig\\Extension\\AssetExtension->makeLinks(NULL)
#1 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_6dc8dc7973e69a95bc5db4f821bb7ab1->doDisplay(Array, Array)
#2 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#3 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#4 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#5 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1347): Twig\\TemplateWrapper->render(Array)
#6 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(76): twig_include(Object(Twig\\Environment), Array, '@MauticReport/G...', Array)
#7 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_750277c492691af516671fa9a7454582->doDisplay(Array, Array)
#8 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#9 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#10 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#11 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1347): Twig\\TemplateWrapper->render(Array)
#12 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(61): twig_include(Object(Twig\\Environment), Array, '@MauticReport/R...', Array, false)
#13 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_a9c7c3e888311bcb0ffe0568097e5fbf->doDisplay(Array, Array)
#14 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#15 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#16 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#17 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1347): Twig\\TemplateWrapper->render(Array)
#18 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(198): twig_include(Object(Twig\\Environment), Array, '@MauticReport/R...')
#19 /var/www/html/vendor/twig/twig/src/Template.php(171): __TwigTemplate_d87c2908016285a2371406ca5f223443->block_content(Array, Array)
#20 /var/www/html/vendor/twig/twig/src/Template.php(243): Twig\\Template->displayBlock('content', Array, Array, true)
#21 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(66): Twig\\Template->renderBlock('content', Array, Array)
#22 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_274f4d32b0e34e384411d368c6082172->doDisplay(Array, Array)
#23 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#24 /var/www/html/vendor/twig/twig/src/Environment.php(360) : eval()'d code(56): Twig\\Template->display(Array, Array)
#25 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_d87c2908016285a2371406ca5f223443->doDisplay(Array, Array)
#26 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\\Template->displayWithErrorHandling(Array, Array)
#27 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\\Template->display(Array)
#28 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\\Template->render(Array)
#29 /var/www/html/vendor/twig/twig/src/Environment.php(280): Twig\\TemplateWrapper->render(Array)
#30 /var/www/html/vendor/symfony/framework-bundle/Controller/AbstractController.php(258): Twig\\Environment->render('@MauticReport/R...', Array)
#31 /var/www/html/vendor/symfony/framework-bundle/Controller/AbstractController.php(266): Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->renderView('@MauticReport/R...', Array)
#32 /var/www/html/app/bundles/CoreBundle/Controller/CommonController.php(178): Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->render('@MauticReport/R...', Array, Object(Symfony\\Component\\HttpFoundation\\Response))
#33 /var/www/html/app/bundles/ReportBundle/Controller/ReportController.php(651): Mautic\\CoreBundle\\Controller\\CommonController->delegateView(Array)
#34 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(163): Mautic\\ReportBundle\\Controller\\ReportController->viewAction(Object(Symfony\\Component\\HttpFoundation\\Request), '15', 1)
#35 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(75): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#36 /var/www/html/vendor/symfony/http-kernel/Kernel.php(202): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#37 /var/www/html/app/AppKernel.php(109): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#38 /var/www/html/app/middlewares/CORSMiddleware.php(76): AppKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#39 /var/www/html/app/middlewares/HSTSMiddleware.php(39): Mautic\\Middleware\\CORSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#40 /var/www/html/app/middlewares/CatchExceptionMiddleware.php(28): Mautic\\Middleware\\HSTSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#41 /var/www/html/app/middlewares/Dev/IpRestrictMiddleware.php(52): Mautic\\Middleware\\CatchExceptionMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#42 /var/www/html/app/middlewares/VersionCheckMiddleware.php(58): Mautic\\Middleware\\Dev\\IpRestrictMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#43 /var/www/html/app/middlewares/TrustMiddleware.php(42): Mautic\\Middleware\\VersionCheckMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#44 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Mautic\\Middleware\\TrustMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#45 /var/www/html/index.php(19): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
#46 {main}
"} {"hostname":"mautic-web","pid":995}

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct




Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.

Metadata

Assignees

No one assigned

    Labels

    T1Low difficulty to fix (issue) or test (PR)bugIssues or PR's relating to bugsregressionA bug that broke something in the last releasereportsAnything related to reportstwig

    Type

    No type

    Projects

    • Status

      🥳 Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions