View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 20892 | Bug reports | Statistics | public | 2026-11-24 14:44 | 2026-11-24 14:44 |
| Reporter | AdamSp | Assigned To | |||
| Priority | none | Severity | crash | ||
| Status | new | Resolution | open | ||
| Product Version | 7.10.x | ||||
| Summary | 20892: New editor Statistics fails on SQL Server: COUNT field incorrect (named parameter :language used twice) | ||||
| Description | On SQL Server (pdo_sqlsrv), the new editor's Statistics page (/editor/#/responses/<sid>/results/statistics) never shows charts. It shows "No responses or compatible data available to display statistics." and a red error toast. This happens even when the survey has completed responses. Environment
Steps to reproduce
Expected: charts for each question. Actual: the "No responses or compatible data available..." message, and this error: CDbCommand failed to execute the SQL statement: SQLSTATE[07002]: The classic statistics API (export_statistics, get_summary) works for the same survey. Cause QuestionStatistics::buildBaseQuery() uses the named placeholder :language twice, once in each of the two joins, and binds it once. pdo_sqlsrv doesn't support reusing a named placeholder, so the parameter count doesn't match. MySQL and PostgreSQL accept it. application/models/services/SurveyStatistics/Charts/Questions/QuestionStatistics.php: the joins are at lines 419 and 421 in 7.10.0 and the binding is at line 428. On current master they are at lines 473, 475 and 482. Fix Use a separate placeholder for each use and bind both: ->leftJoin('{{question_l10ns}} ql', 'q.qid = ql.qid AND ql.language = :language') With this change, both charts render correctly on SQL Server 2022 (checked on 7.10.0). Other queries in the new statistics and responses code may reuse a named placeholder in the same way, so they're worth checking too. | ||||
| Steps To Reproduce | Steps to reproduce(Replace this text with detailed step-by-step instructions on how to reproduce the issue) Expected result(Write here what you expected to happen) Actual result(Write here what happened instead) | ||||
| Tags | No tags attached. | ||||
| Bug heat | 0 | ||||
| Complete LimeSurvey version number (& build) | 7.10.0 | ||||
| I will donate to the project if issue is resolved | Yes | ||||
| Browser | |||||
| Database type & version | Microsoft SQL Server 2022 | ||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | 8.4.28 | ||||
| Git branch / Pull Request URL | |||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-24 14:44 | AdamSp | New Issue |