View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18704Bug reportsSurvey editingpublic2023-03-30 12:50
Reporter2BITS_PL Assigned To 
PrioritynoneSeveritypartial_block 
Status newResolutionopen 
Product Version5.5.x 
Summary18704: Again Error [SQL Server] IDENTITY_INSERT is set ON for table 'limesurvey_quota_languagesettings'
Description

[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Explicit value must be specified for identity column in table 'lime_quota_languagesettings' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column."

Identical situation as in ticket 17356, but in a completely different place. Tested on LS v5.4.11 (can't check on a newer version at the moment).

Steps To Reproduce

Steps to reproduce

  1. Import the prepared survey
  2. Go to "Global Settings" of the poll (survey must be active)
  3. Add another language version and click save

Actual result

In DevTools for the URL invoked: admin/database/index/updatesurveylocalesettings_generalsettings returns "Explicit value must be specified for identity column in table 'lime_quota_languagesettings' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column."

In the file: https://github.com/LimeSurvey/LimeSurvey/blob/5.4.11%2B221114/application/helpers/common_helper.php#L3767
IDENTITY_INSERT is set to ON and quotals_id is not set in Yii::app()->db->createCommand()->insert('{{quota_languagesettings}}', $data);

If you set IDENTITY_INSERT to FALSE in the line above, the problem will be solved.
The question is, shouldn't the IDENTITY_INSERT settings be reversed here, first to FALSE (line 3788) and finally to TRUE (line 3809) ?

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)Version 5.4.11+221114
I will donate to the project if issue is resolvedNo
Browser
Database type & versionSQL Server 2019
Server OS (if known)Microsoft Server 2019
Webserver software & version (if known)
PHP Versionv8.0.27 NTS x64

Users monitoring this issue

User List 2BITS_PL

Activities

2BITS_PL

2BITS_PL

2023-03-27 12:18

reporter  

2BITS_PL

2BITS_PL

2023-03-30 12:47

reporter   ~74312

confirmed in LS v5.6.13

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Explicit value must be specified for identity column in table 'lime_quota_languagesettings' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.

2BITS_PL

2BITS_PL

2023-03-30 12:50

reporter   ~74313

This can be quickly fixed by changing:
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/common_helper.php#L3788

with: switchMSSQLIdentityInsert('quota_languagesettings', true);
on: switchMSSQLIdentityInsert('quota_languagesettings', false);

in this case, this line would have to be removed:
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/common_helper.php#L3809

Issue History

Date Modified Username Field Change
2023-03-27 12:18 2BITS_PL New Issue
2023-03-27 12:18 2BITS_PL File Added: survey_archive_328453.lsa
2023-03-27 15:06 ollehar Product Version => 5.5.x
2023-03-30 12:47 2BITS_PL Note Added: 74312
2023-03-30 12:47 2BITS_PL File Added: error_identity_insert_in_ls_v5613.png
2023-03-30 12:47 2BITS_PL Bug heat 0 => 2
2023-03-30 12:50 2BITS_PL Note Added: 74313
2023-03-30 12:50 2BITS_PL Issue Monitored: 2BITS_PL
2023-03-30 12:50 2BITS_PL Bug heat 2 => 4