Reproduction steps:
- Create a new bar chart
- Select some source data
On the front end side an error will be displayed
An error occurred while loading the chart: JSON.parse: unexpected character at line 1 column 1 of the JSON data
If you look at the source of the error you will see it is caused by a malformed SQL query:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
use near '' at line 11:
#0 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(985): PDO->query()
#1 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(948): ParagonIE\EasyDB\EasyDB->safeQuery()
#2 /usr/share/tuleap/plugins/graphontrackersv5/include/data-transformation/GraphOnTrackersV5_Chart_BarDataBuilder.class.php(120): ParagonIE\EasyDB\EasyDB->run()
#3 /usr/share/tuleap/plugins/graphontrackersv5/include/data-transformation/GraphOnTrackersV5_Chart_BarDataBuilder.class.php(58): GraphOnTrackersV5_Chart_BarDataBuilder->getQueryResult()
#4 /usr/share/tuleap/plugins/graphontrackersv5/include/data-access/GraphOnTrackersV5_Chart.class.php(431): GraphOnTrackersV5_Chart_BarDataBuilder->buildProperties()
#5 /usr/share/tuleap/plugins/graphontrackersv5/include/data-access/GraphOnTrackersV5_Chart.class.php(365): GraphOnTrackersV5_Chart->getEngineWithData()
#6 /usr/share/tuleap/plugins/graphontrackersv5/include/Async/ChartDataController.php(99): GraphOnTrackersV5_Chart->fetchAsArray()
#7 /usr/share/tuleap/src/common/Http/Server/RequestHandlerAsMiddleware.php(44): Tuleap\GraphOnTrackersV5\Async\ChartDataController->handle()
#8 /usr/share/tuleap/src/common/Http/Server/MiddlewareDispatcher.php(52): Tuleap\Http\Server\RequestHandlerAsMiddleware->process()
#9 /usr/share/tuleap/src/common/Http/Server/SessionWriteCloseMiddleware.php(36): Tuleap\Http\Server\MiddlewareDispatcher->handle()
#10 /usr/share/tuleap/src/common/Http/Server/MiddlewareDispatcher.php(52): Tuleap\Http\Server\SessionWriteCloseMiddleware->process()
#11 /usr/share/tuleap/src/common/Request/DispatchablePSR15Compatible.php(62): Tuleap\Http\Server\MiddlewareDispatcher->handle()
#12 /usr/share/tuleap/src/common/Request/FrontRouter.php(248): Tuleap\Request\DispatchablePSR15Compatible->process()
#13 /usr/share/tuleap/src/common/Request/FrontRouter.php(108): Tuleap\Request\FrontRouter->routeHandler()
#14 /usr/share/tuleap/src/www/index.php(49): Tuleap\Request\FrontRouter->route()
#15 {main}