View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
13821 | Bug reports | Import/Export | public | 2018-06-27 12:07 | 2020-03-06 00:43 |
Reporter | MerkOne | Assigned To | |||
Priority | none | Severity | block | ||
Status | closed | Resolution | fixed | ||
Product Version | 3.12.x | ||||
Fixed in Version | 3.22.7 | ||||
Summary | 13821: When importing a survey I receive a "Failed to Insert [3]" error message | ||||
Description | Exporting survey from Live webserver, importing into local webserver. The import creates the survey, the 1st question group and an empty question and then throws the error. I also receive the same error when importing just a question group. Importing a question by itself works (kind of - another bug report). | ||||
Steps To Reproduce | Create survey on Live webserver Log into local hosted version Error occurs | ||||
Additional Information | I have also seen a DBCommand error once, but have been unable to reproduce. This problem also seems to affect creating a question, when creating a question and pressing "Save" it takes me to a blank page. Pressing back shows the question was created. This doesnt occur if I press "Save and New" | ||||
Tags | No tags attached. | ||||
Bug heat | 10 | ||||
Complete LimeSurvey version number (& build) | 3.12.2+180625 & 3.12.3 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Chrome | ||||
Database type & version | sqlsrv | ||||
Server OS (if known) | Linux 3.10.0-514.el7.x86_64 #1 SMP | ||||
Webserver software & version (if known) | Apache/2.4.6 (Red Hat Enterprise Linux) | ||||
PHP Version | 7.0.30 | ||||
I cannot reproduce that in 3.12.3 |
|
I have updated with the latest ComfortUpdate & am still seeing this error. |
|
Further note, if I press "Create Question Group" directly after the import fails, I see this error; Internal Server Error |
|
I have grabbed the latest source code from GitHub, configured it to be hosted locally and pointed at a local SQL database. I have then tried to import a survey exported from the Live version (hosted here) and it throws the "Error: Failed to insert data [3]" message. So definitely nothing to do with my hosted version. I'm going to try and debug it next. |
|
Confirmed that this is still an issue in the latest ComfortUpdate. |
|
Hi, I'll try to reproduce it tomorow. |
|
Hi all, additional Information: Despite this error message, the survey gets imported, but only with question groups and without questions! |
|
Client requirements I'm afraid, they are a MSSQL shop. |
|
How does your freetds.conf look like? |
|
I dont appear to have a freetds.conf file on my local machine (Windows) which is displaying the error. I'll try and grab the copy of the RedHat box which is also experiencing the problem. |
|
I have put in a pull request to address the fix. The issue is that the SQL PDO driver has changed its implementation so if you pass in a sequence name, it will always try and get a ID from a sequence, even on MSSQL. Comment from the code; "Before version 5.0, the SQLSRV driver supports PDO::lastInsertId() with one peculiarity: when $sequence's value is null or empty string it returns empty string. But when parameter is not specified at all it's working as expected and returns actual last inserted ID (like other PDO drivers). 5.0 of the Microsoft PHP Drivers for SQL Server changes the behaviour of PDO::lastInsertID to be consistent with the behaviour outlined in the PDO documentation. It returns the ID of the last inserted sequence or row." This change has come from the tip of the yii-1.19-dev code I'm not sure if their will be a further release (yii 1.1x is at end of life). Pull Request Here: https://github.com/LimeSurvey/LimeSurvey/pull/1090 |
|
The relevant yii commit is here: https://github.com/yiisoft/yii/commit/7b768c304289ede574768de68939224d1180e2b1 |
|
Hi, any update on when this issue and\or pull request might be reviewed? |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=27599 |
|
This version of LimeSurvey is not longer supported. Please check so that the issue is fixed in a more recent version of LimeSurvey. If it's not, reopen this bug report. Thank you. |
|
LimeSurvey: master d69915c1 2018-07-09 12:59
Committer: Details Diff |
Fixed issue 13821: When importing a survey I receive a "Failed to Insert [3]" error message (#1090) Dev: This issue is caused by a change in the sql pdo driver Dev: without this fix, new ids aren't returned from tables with identity columns in mssql Dev: This causes questions not to save correctly (import, new etc) Dev: This fix is from the yii 1.19-dev label, commit: Dev: Commit 7b768c304289ede574768de68939224d1180e2b1 |
Affected Issues 13821 |
|
mod - framework/db/schema/mssql/CMssqlSqlsrvPdoAdapter.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-06-27 12:07 | MerkOne | New Issue | |
2018-06-27 14:31 | c_schmitz | Assigned To | => c_schmitz |
2018-06-27 14:31 | c_schmitz | Status | new => feedback |
2018-06-27 14:31 | c_schmitz | Note Added: 48318 | |
2018-06-27 14:37 | MerkOne | Note Added: 48320 | |
2018-06-27 14:37 | MerkOne | Status | feedback => assigned |
2018-06-27 14:52 | c_schmitz | Assigned To | c_schmitz => LouisGac |
2018-06-27 16:20 | MerkOne | Note Added: 48348 | |
2018-06-28 15:26 | MerkOne | Note Added: 48362 | |
2018-06-28 17:33 | MerkOne | Note Added: 48376 | |
2018-06-28 18:04 |
|
Note Added: 48379 | |
2018-06-29 09:54 | efingdmi | Note Added: 48386 | |
2018-06-29 09:55 | efingdmi | Issue Monitored: efingdmi | |
2018-06-29 11:28 | MerkOne | Note Added: 48396 | |
2018-06-29 14:41 | c_schmitz | Note Added: 48410 | |
2018-06-29 14:42 | c_schmitz | Note Edited: 48410 | |
2018-06-29 15:05 | MerkOne | Note Added: 48413 | |
2018-07-02 11:11 | MerkOne | Note Added: 48429 | |
2018-07-02 11:25 | MerkOne | Note Added: 48431 | |
2018-07-02 11:37 | MerkOne | Issue Monitored: MerkOne | |
2018-07-02 11:37 | MerkOne | Issue End Monitor: MerkOne | |
2018-07-05 15:27 | MerkOne | Note Added: 48455 | |
2018-07-09 10:59 |
|
Changeset attached | => LimeSurvey master d69915c1 |
2018-07-09 10:59 |
|
Note Added: 48466 | |
2018-07-09 10:59 |
|
Resolution | open => fixed |
2019-05-23 09:56 | c_schmitz | Relationship added | related to 13822 |
2020-03-06 00:43 | c_schmitz | Status | assigned => closed |
2020-03-06 00:43 | c_schmitz | Fixed in Version | => 3.22.7 |
2020-03-06 00:43 | c_schmitz | Note Added: 56344 | |
2021-08-02 17:13 | guest | Bug heat | 8 => 10 |