View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
18627 | Bug reports | Survey taking | public | 2023-02-07 14:37 | 2024-11-19 18:15 |
Reporter | tbart | Assigned To | tibor.pacalat | ||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 3.28.x | ||||
Summary | 18627: Missing SQL query errors in admin mail (SQL CODE THAT FAILED) | ||||
Description | Some participants enter their data but it cannot be saved. Basically, it boils down to $message .= $this->gT("Unable to insert record into survey table"); // TODO - add SQL error? This SQL error is direly needed. submitfailed() supports providing the query as second parameter, but as I am no developer I don't know how to fetch the query at this point. I selected 3.28.x as current version, but this also affects current master on github. | ||||
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 | 12 | ||||
Complete LimeSurvey version number (& build) | Version 3.28.19+220712 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | 10.3.37-MariaDB | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 7.4 | ||||
I believe the problem is here: The error should be handled outside the model as to be able to know what happened.
@DenisChenu thoughts? @tbart do we have reproduction steps? |
|
Another option would be to setup a new file logger on the internals and start logging these kind of things. |
|
I always think we must remove insertRecords and use cleand response model We do it for update : https://github.com/LimeSurvey/LimeSurvey/blob/e4ce8389830892d6e1cd06eafec624d978d7b910/application/helpers/expressions/em_manager_helper.php#L5147 Added to use PDO : https://github.com/LimeSurvey/LimeSurvey/pull/1353 Else
There are 2 issue here
One idea : insertRecords do
But i think best solution is to use model directly and remove usage of insertRecords (maybe just the minimal : insert empty recorrd). |
|
It must not be submitfailed(CHTml::errorSummary($oResponse)) ? Else i found this to have the SQL : https://stackoverflow.com/a/60170086 |
|
That looks more like a change for DEV.
We can set the parameter of saveEncrypt to true, and will do the trick.
I don't like to try/catch inside the model.
I would just not handle it inside the model, and handle it outside. |
|
You don't like the idea of only logging SQL queries which failed? Also errors? |
|
Why an new logger ? Just use Yii::log ad error if you want But : need to send the error in email. |
|
Else
Maybe but i think it's the only good way to fix … or just add $e->message to the email and «basta» |
|
People need to see the error. If it is SQL, good. But I guess error log will be better than nothgin (and easier). Probably will be enough.
Problem is that by default, on live envs, nothing is logged, not even errors. |
|
For me, 2 different tickets: BUg and Enahncement. |
|
then adding $e->message in email. |
|
Yes, consdering then that the exception is not treated inside the model |
|
I'd very much like to add reproduction steps, but that's a chicken and egg problem. If I don't know when something goes wrong, I am unable to trigger it :-( |
|
Will prepare something so you can apply individually and test... You were referring to that? |
|
@tbart : a way to test Activate a survey (number 1234) Rename a column of survey_1234 via the DB |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35481 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35482 |
|
Tested and merged fix for master. |
|
LimeSurvey: master 19d1cad3 2023-09-14 19:55 Gabriel Jenik Committer: GitHub Details Diff |
Fixed bug 18627: Missing SQL query errors in admin mail (SQL CODE THAT FAILED) (#3372) Co-authored-by: Lapiu Dev <devgit@lapiu.biz> |
Affected Issues 18627 |
|
mod - application/helpers/admin/import_helper.php | Diff File | ||
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
mod - application/models/SurveyDynamic.php | Diff File | ||
mod - tests/TestBaseClass.php | Diff File | ||
add - tests/unit/models/SurveyDynamicTest.php | Diff File | ||
LimeSurvey: master 19d1cad3 2023-09-14 19:55 Gabriel Jenik Committer: GitHub Details Diff |
Fixed bug 18627: Missing SQL query errors in admin mail (SQL CODE THAT FAILED) (#3372) Co-authored-by: Lapiu Dev <devgit@lapiu.biz> |
Affected Issues 18627 |
|
mod - application/helpers/admin/import_helper.php | Diff File | ||
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
mod - application/models/SurveyDynamic.php | Diff File | ||
mod - tests/TestBaseClass.php | Diff File | ||
add - tests/unit/models/SurveyDynamicTest.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-02-07 14:37 | tbart | New Issue | |
2023-02-07 14:38 | tbart | Issue Monitored: tbart | |
2023-02-07 14:38 | tbart | Bug heat | 0 => 2 |
2023-07-27 00:00 | gabrieljenik | Note Added: 76285 | |
2023-07-27 00:00 | gabrieljenik | Bug heat | 2 => 4 |
2023-07-27 00:04 | gabrieljenik | Note Added: 76286 | |
2023-07-27 07:55 | DenisChenu | Note Added: 76289 | |
2023-07-27 07:55 | DenisChenu | Bug heat | 4 => 6 |
2023-07-27 08:03 | DenisChenu | Note Added: 76290 | |
2023-07-27 15:08 | gabrieljenik | Note Added: 76298 | |
2023-07-27 15:09 | gabrieljenik | Note Added: 76299 | |
2023-07-27 15:09 | gabrieljenik | Status | new => confirmed |
2023-07-27 15:19 | DenisChenu | Note Added: 76300 | |
2023-07-27 15:31 | DenisChenu | Note Added: 76304 | |
2023-07-27 15:54 | gabrieljenik | Note Added: 76306 | |
2023-07-27 15:55 | gabrieljenik | Note Added: 76307 | |
2023-07-27 15:55 | gabrieljenik | Note Edited: 76306 | |
2023-07-27 15:55 | gabrieljenik | Note Edited: 76307 | |
2023-07-27 17:11 | DenisChenu | Note Added: 76310 | |
2023-07-27 19:19 | gabrieljenik | Note Added: 76316 | |
2023-08-07 18:53 | tbart | Note Added: 76466 | |
2023-08-07 18:53 | tbart | Bug heat | 6 => 8 |
2023-08-07 20:41 | gabrieljenik | Note Added: 76468 | |
2023-08-18 14:56 | gabrieljenik | Assigned To | => DenisChenu |
2023-08-18 14:56 | gabrieljenik | Status | confirmed => ready for code review |
2023-08-18 14:56 | gabrieljenik | Note Added: 76643 | |
2023-08-30 12:00 | DenisChenu | Assigned To | DenisChenu => |
2023-08-30 12:00 | DenisChenu | Status | ready for code review => ready for testing |
2023-08-30 12:02 | DenisChenu | Note Added: 76782 | |
2023-08-30 15:52 | gabrieljenik | Assigned To | => tibor.pacalat |
2023-09-14 17:55 | Changeset attached | => LimeSurvey master 19d1cad3 | |
2023-09-14 17:55 | guest | Note Added: 77053 | |
2023-09-14 17:55 | Changeset attached | => LimeSurvey master 19d1cad3 | |
2023-09-14 17:55 | guest | Note Added: 77054 | |
2023-09-14 17:55 | guest | Bug heat | 8 => 10 |
2023-09-14 17:56 | tibor.pacalat | Status | ready for testing => resolved |
2023-09-14 17:56 | tibor.pacalat | Resolution | open => fixed |
2023-09-14 17:56 | tibor.pacalat | Note Added: 77055 | |
2023-09-14 17:56 | tibor.pacalat | Bug heat | 10 => 12 |
2024-11-19 18:15 | c_schmitz | Status | resolved => closed |